// Code generated by convertFourslash; DO NOT EDIT.
// To modify this test, run "npm run makemanual importNameCodeFix_require_importVsRequire_moduleTarget"

package fourslash_test

import (
	"testing"

	"github.com/microsoft/typescript-go/internal/fourslash"
	"github.com/microsoft/typescript-go/internal/testutil"
)

func TestImportNameCodeFix_require_importVsRequire_moduleTarget(t *testing.T) {
	fourslash.SkipIfFailing(t)
	t.Parallel()
	defer testutil.RecoverAndFail(t, "Panic on fourslash test")
	const content = `// @allowJs: true
// @checkJs: true
// @module: es2015
// @Filename: a.js
export const x = 0;
// @Filename: index.js
x`
	f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
	defer done()
	f.GoToFile(t, "index.js")
	f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
		Description: "Add import from \"./a\"",
		NewFileContent: `import { x } from "./a";

x`,
		Index: 0,
	})
	f.GoToPosition(t, 0)
	f.InsertLine(t, "const fs = require('fs');\n")
	f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
		Description: "Add import from \"./a\"",
		NewFileContent: `const fs = require('fs');
const { x } = require('./a');

x`,
		Index: 0,
	})
}
