1
1
import * as path from 'path' ;
2
+ import { fileURLToPath } from 'url' ;
2
3
// @ts -ignore - no types
3
- import * as run from 'test262-parser-runner' ;
4
+ import run from 'test262-parser-runner' ;
4
5
import * as acorn from 'acorn' ;
5
- import { tsPlugin } from '../src ' ;
6
+ import { tsPlugin } from '../lib/index.mjs ' ;
6
7
7
8
const parser = acorn . Parser . extend ( tsPlugin ( ) ) ;
8
- const UNSUPPORTED_FEATURES : string [ ] = [
9
+ const UNSUPPORTED_FEATURES = [
9
10
'regexp-v-flag' ,
10
11
'regexp-duplicate-named-groups' ,
11
12
'import-assertions' ,
@@ -14,7 +15,7 @@ const UNSUPPORTED_FEATURES: string[] = [
14
15
'import-attributes'
15
16
] ;
16
17
17
- const SKIP_FILES : string [ ] = [
18
+ const SKIP_FILES = [
18
19
// `1 < 2 > 3;` cannot be parsed well.
19
20
// This is because `< 2 >` is judged as TypeArguments.
20
21
// See https://github.com/TyrealHu/acorn-typescript/issues/21
@@ -23,7 +24,7 @@ const SKIP_FILES: string[] = [
23
24
24
25
// Some keywords still don't throw an error.
25
26
// See https://github.com/TyrealHu/acorn-typescript/issues/23
26
- const WHITELIST : string [ ] = [
27
+ const WHITELIST = [
27
28
// `this` variable name. e.g. `var this = 42`
28
29
'language/identifiers/val-this.js' ,
29
30
'language/identifiers/val-this-via-escape-hex.js' ,
71
72
} ) ;
72
73
} ,
73
74
{
74
- testsDirectory : path . dirname ( require . resolve ( 'test262/package.json' ) ) ,
75
+ testsDirectory : path . dirname ( fileURLToPath ( import . meta . resolve ( 'test262/package.json' ) ) ) ,
75
76
skip : ( test ) => {
76
77
return (
77
78
( test . attrs . features &&
0 commit comments