mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
29 lines
596 B
TypeScript
29 lines
596 B
TypeScript
//// [tests/cases/conformance/externalModules/importNonExternalModule.ts] ////
|
|
|
|
//// [foo_0.ts]
|
|
namespace foo {
|
|
export var answer = 42;
|
|
}
|
|
|
|
//// [foo_1.ts]
|
|
import foo = require("./foo_0");
|
|
// Import should fail. foo_0 not an external module
|
|
if(foo.answer === 42){
|
|
|
|
}
|
|
|
|
|
|
//// [foo_0.js]
|
|
"use strict";
|
|
var foo;
|
|
(function (foo) {
|
|
foo.answer = 42;
|
|
})(foo || (foo = {}));
|
|
//// [foo_1.js]
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const foo = require("./foo_0");
|
|
// Import should fail. foo_0 not an external module
|
|
if (foo.answer === 42) {
|
|
}
|