2015-10-15 02:36:03 +02:00
|
|
|
///<reference path="fourslash.ts" />
|
|
|
|
|
|
|
|
// Assignments to 'module.exports' create an external module
|
|
|
|
|
2015-11-13 22:44:57 +01:00
|
|
|
// @allowJs: true
|
2015-10-15 02:36:03 +02:00
|
|
|
// @Filename: myMod.js
|
|
|
|
//// if (true) {
|
|
|
|
//// module.exports = { a: 10 };
|
|
|
|
//// }
|
|
|
|
//// var invisible = true;
|
|
|
|
|
|
|
|
// @Filename: isGlobal.js
|
|
|
|
//// var y = 10;
|
|
|
|
|
|
|
|
// @Filename: consumer.js
|
2016-02-13 00:40:47 +01:00
|
|
|
//// var x = require('./myMod');
|
2015-10-15 02:36:03 +02:00
|
|
|
//// /**/;
|
|
|
|
|
|
|
|
goTo.file('consumer.js');
|
|
|
|
goTo.marker();
|
|
|
|
|
2019-05-16 23:46:10 +02:00
|
|
|
verify.completions({
|
|
|
|
marker: "",
|
|
|
|
includes: { name: "y", sortText: completion.SortText.GlobalsOrKeywords },
|
|
|
|
excludes: "invisible"
|
|
|
|
});
|
2015-10-15 02:36:03 +02:00
|
|
|
|
|
|
|
edit.insert('x.');
|
2018-10-29 18:03:25 +01:00
|
|
|
verify.completions({ includes: { name: "a", kind: "property" } });
|
2016-01-30 01:01:41 +01:00
|
|
|
edit.insert('a.');
|
2018-10-30 19:56:34 +01:00
|
|
|
verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } });
|