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

package fourslash_test

import (
	"testing"

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

func TestImportNameCodeFix_require_importVsRequire_importWins(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: addToExisting.js
const { Named2 } = require('./blah')
import { Named1 } from './blah'

new Blah
// @Filename: newImport.js
import fs from 'fs';
const path = require('path');

new Blah`
	f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
	defer done()
	f.GoToFile(t, "addToExisting.js")
	f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
		Description: "Update import from \"./blah\"",
		NewFileContent: `const { Named2 } = require('./blah')
import Blah, { Named1 } from './blah'

new Blah`,
		Index: 0,
	})
	f.GoToFile(t, "newImport.js")
	f.VerifyCodeFix(t, fourslash.VerifyCodeFixOptions{
		Description: "Add import from \"./blah\"",
		NewFileContent: `import fs from 'fs';
import Blah from './blah';
const path = require('path');

new Blah`,
		Index: 0,
	})
}
