mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual importNameCodeFix_require_addToExisting"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestImportNameCodeFix_require_addToExisting(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `// @allowJs: true
|
|
// @checkJs: true
|
|
// @Filename: blah.js
|
|
export default class Blah {}
|
|
export const Named1 = 0;
|
|
export const Named2 = 1;
|
|
// @Filename: index.js
|
|
var path = require('path')
|
|
, { promisify } = require('util')
|
|
, { Named1 } = require('./blah')
|
|
|
|
new Blah`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.GoToFile(t, "index.js")
|
|
f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
|
|
Description: "Update import from \"./blah\"",
|
|
NewFileContent: `var path = require('path')
|
|
, { promisify } = require('util')
|
|
, { Named1, default: Blah } = require('./blah')
|
|
|
|
new Blah`,
|
|
Index: 0,
|
|
})
|
|
}
|