Skip to content

Commit 5e009bb

Browse files
committed
Start porting ESM tests
1 parent 10d852d commit 5e009bb

6 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
prefix parallel
2+
3+
# To mark a test as flaky, list the test name in the appropriate section
4+
# below, without ".js", followed by ": PASS,FLAKY". Example:
5+
# sample-test : PASS,FLAKY
6+
7+
[true] # This section applies to all platforms
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import '../common';
2+
import assert from 'assert';
3+
import ok from './test-esm-ok.mjs';
4+
import okShebang from './test-esm-shebang.mjs';
5+
6+
assert(ok);
7+
assert(okShebang);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import '../common';
2+
3+
if (typeof arguments !== 'undefined') {
4+
throw new Error('not an ESM');
5+
}
6+
if (typeof this !== 'undefined') {
7+
throw new Error('not an ESM');
8+
}
9+
if (typeof exports !== 'undefined') {
10+
throw new Error('not an ESM');
11+
}
12+
if (typeof require !== 'undefined') {
13+
throw new Error('not an ESM');
14+
}
15+
if (typeof module !== 'undefined') {
16+
throw new Error('not an ESM');
17+
}
18+
if (typeof __filename !== 'undefined') {
19+
throw new Error('not an ESM');
20+
}
21+
if (typeof __dirname !== 'undefined') {
22+
throw new Error('not an ESM');
23+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import '../common';
2+
3+
const isJs = true;
4+
export default isJs;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! }]) // isn't js
2+
import '../common';
3+
4+
const isJs = true;
5+
export default isJs;

β€Žtest/es-module/testcfg.pyβ€Ž

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import sys, os
2+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
3+
import testpy
4+
5+
def GetConfiguration(context, root):
6+
return testpy.SimpleTestConfiguration(context, root, 'es-module')

0 commit comments

Comments
Β (0)