Skip to content

Commit e508e1f

Browse files
committed
chore: fix tests in ESM mode
1 parent 6bf74b4 commit e508e1f

7 files changed

+16
-10
lines changed

test/astx/addImports-relative.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import dedent from 'dedent-js'
55

66
astxTestcase({
77
file: __filename,
8-
transformFile: Path.resolve(__dirname, 'foo/transform.ts'),
8+
transformFile: Path.resolve(__filename, '..', 'foo/transform.ts'),
99
input: dedent`
1010
import {a} from '../a'
1111
import {b} from 'b'

test/astx/replaceImport-rename-capture-relative.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import dedent from 'dedent-js'
55

66
astxTestcase({
77
file: __filename,
8-
transformFile: Path.resolve(__dirname, 'bar/transform.ts'),
8+
transformFile: Path.resolve(__filename, '..', 'bar/transform.ts'),
99
input: dedent`
1010
import { foo as blah } from '../foo'
1111
import bar from 'bar'

test/findReplace/relativeExportAllMatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44

55
findReplaceTestcase({
66
file: __filename,
7-
transformFile: path.resolve(__dirname, 'test/transform.ts'),
7+
transformFile: path.resolve(__filename, '..', 'test/transform.ts'),
88
input: dedent`
99
export * from '../foo'
1010
export * from './foo'

test/findReplace/relativeExportNamedMatch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44

55
findReplaceTestcase({
66
file: __filename,
7-
transformFile: path.resolve(__dirname, 'test/transform.ts'),
7+
transformFile: path.resolve(__filename, '..', 'test/transform.ts'),
88
input: dedent`
99
export { a } from '../foo'
1010
export { b } from './foo'
@@ -17,7 +17,9 @@ findReplaceTestcase({
1717
`,
1818
expectedFind: [
1919
{
20-
arrayCaptures: { $$a: ['a'] },
20+
arrayCaptures: {
21+
$$a: ['a'],
22+
},
2123
node: `export { a } from '../foo'`,
2224
},
2325
],

test/findReplace/relativeImportExpressionMatch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44

55
findReplaceTestcase({
66
file: __filename,
7-
transformFile: path.resolve(__dirname, 'test/transform.ts'),
7+
transformFile: path.resolve(__filename, '..', 'test/transform.ts'),
88
input: dedent`
99
import('../foo')
1010
import('./foo')

test/findReplace/relativeImportMatch.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44

55
findReplaceTestcase({
66
file: __filename,
7-
transformFile: path.resolve(__dirname, 'test/transform.ts'),
7+
transformFile: path.resolve(__filename, '..', 'test/transform.ts'),
88
input: dedent`
99
import a from '../foo'
1010
import b from './foo'
@@ -17,7 +17,9 @@ findReplaceTestcase({
1717
`,
1818
expectedFind: [
1919
{
20-
captures: { $x: 'a' },
20+
captures: {
21+
$x: 'a',
22+
},
2123
node: `import a from '../foo'`,
2224
},
2325
],

test/findReplace/relativeImportMatch2.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'path'
44

55
findReplaceTestcase({
66
file: __filename,
7-
transformFile: path.resolve(__dirname, '..', 'transform.ts'),
7+
transformFile: path.resolve(__filename, '..', '..', 'transform.ts'),
88
input: dedent`
99
import a from '../foo'
1010
import b from './foo'
@@ -17,7 +17,9 @@ findReplaceTestcase({
1717
`,
1818
expectedFind: [
1919
{
20-
captures: { $x: 'a' },
20+
captures: {
21+
$x: 'a',
22+
},
2123
node: `import a from '../foo'`,
2224
},
2325
],

0 commit comments

Comments
 (0)