* Support add new requires * Always use destructuring for requiring default exports * Add more tests * Update existing fourslash tests * Use `getExportsAndPropertiesOfModule` * Add UMD test * Apply suggestions from code review Fix typos Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
25 lines
427 B
TypeScript
25 lines
427 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
|
|
// @Filename: umd.d.ts
|
|
////namespace Foo { function f() {} }
|
|
////export = Foo;
|
|
////export as namespace Foo;
|
|
|
|
// @Filename: index.js
|
|
////Foo;
|
|
////module.exports = {};
|
|
|
|
goTo.file("index.js");
|
|
verify.codeFix({
|
|
index: 0,
|
|
description: `Import 'Foo' from module "./umd"`,
|
|
newFileContent:
|
|
`const Foo = require("./umd");
|
|
|
|
Foo;
|
|
module.exports = {};`
|
|
});
|