mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual importNameCodeFix_commonjs_allowSynthetic"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestImportNameCodeFix_commonjs_allowSynthetic(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @module: esnext
|
|
// @moduleResolution: bundler
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @allowSyntheticDefaultImports: true
|
|
// @Filename: /test_module.js
|
|
const MY_EXPORTS = {}
|
|
module.exports = MY_EXPORTS;
|
|
// @Filename: /index.js
|
|
const newVar = {
|
|
any: MY_EXPORTS/**/,
|
|
}`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToMarker(t, "")
|
|
f.VerifyImportFixAtPosition(t, []string{
|
|
`const MY_EXPORTS = require("./test_module");
|
|
|
|
const newVar = {
|
|
any: MY_EXPORTS,
|
|
}`,
|
|
}, nil /*preferences*/)
|
|
}
|