File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -60,4 +60,33 @@ describe('ESM', function() {
60
60
}
61
61
} ) ;
62
62
63
+ it ( 'prints the task list (top-level await)' , function ( done ) {
64
+ if ( shouldSkip ( ) ) {
65
+ this . skip ( ) ;
66
+ }
67
+
68
+ var options = '--tasks --sort-tasks --gulpfile ./test/fixtures/gulpfiles/gulpfile-tla.mjs' ;
69
+ var trailingLines = 1 ;
70
+ if ( ! semver . satisfies ( process . version , '^12.17.0 || >=13.2.0' ) ) {
71
+ options += ' --experimental-modules' ;
72
+ trailingLines += 2 ;
73
+ }
74
+
75
+ var opts = { cwd : baseDir } ;
76
+ exec ( gulp ( options ) , opts , cb ) ;
77
+
78
+ function cb ( err , stdout , stderr ) {
79
+ expect ( err ) . toBeNull ( ) ;
80
+ if ( ! semver . satisfies ( process . version , '^12.20.0 || >=13.14.0' ) ) {
81
+ expect ( stderr ) . toMatch ( 'ExperimentalWarning: The ESM module loader is experimental.\n' ) ;
82
+ } else {
83
+ expect ( stderr ) . toEqual ( '' ) ;
84
+ }
85
+ var filepath = path . join ( expectedDir , 'esm.txt' ) ;
86
+ var expected = fs . readFileSync ( filepath , 'utf-8' ) ;
87
+ expect ( sliceLines ( stdout , trailingLines ) ) . toEqual ( expected ) ;
88
+ done ( err ) ;
89
+ }
90
+ } ) ;
91
+
63
92
} ) ;
Original file line number Diff line number Diff line change
1
+ const dynamicNoop = await Promise . resolve ( function noop ( cb ) {
2
+ cb ( ) ;
3
+ } ) ;
4
+
5
+ export const registered = dynamicNoop ;
6
+ export function exported ( ) { } ;
7
+ export const string = 'no function' ;
You can’t perform that action at this time.
0 commit comments