mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
994 B
Go
37 lines
994 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual importNameCodeFix_require_namedAndDefault"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestImportNameCodeFix_require_namedAndDefault(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @allowJs: true
|
|
// @checkJs: true
|
|
// @Filename: blah.ts
|
|
export default class Blah {}
|
|
export const Named1 = 0;
|
|
export const Named2 = 1;
|
|
// @Filename: index.js
|
|
Named1 + Named2;
|
|
new Blah;`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "index.js")
|
|
f.VerifyCodeFixAll(t, fourslash.VerifyCodeFixAllOptions{
|
|
FixID: "fixMissingImport",
|
|
NewFileContent: `const { default: Blah, Named1, Named2 } = require("./blah");
|
|
|
|
Named1 + Named2;
|
|
new Blah;`,
|
|
})
|
|
}
|