|
4 | 4 |
|
5 | 5 | import * as path from 'path'; |
6 | 6 | import { fileURLToPath } from 'url'; |
| 7 | +import { before, describe, it } from 'node:test'; |
7 | 8 | import { createHelpers } from 'yeoman-test'; |
8 | 9 | import { parse } from 'jsonc-parser'; |
9 | 10 | import * as env from '../generators/app/env.js'; |
10 | 11 |
|
11 | | -describe('test code generator', function () { |
12 | | - this.timeout(10000); |
| 12 | +describe('test code generator', { timeout: 10000 }, () => { |
13 | 13 |
|
14 | 14 | const helpers = createHelpers(); |
15 | 15 | const appLocation = path.join(fileURLToPath(import.meta.url), '../../generators/app'); |
@@ -275,8 +275,7 @@ describe('test code generator', function () { |
275 | 275 | } |
276 | 276 | }); |
277 | 277 |
|
278 | | - it('language import', async () => { |
279 | | - this.timeout(10000); |
| 278 | + it('language import', { timeout: 10000 }, async () => { |
280 | 279 |
|
281 | 280 | const runResult = await helpers.run(appLocation).withAnswers({ |
282 | 281 | type: 'ext-language', |
@@ -327,8 +326,7 @@ describe('test code generator', function () { |
327 | 326 | } |
328 | 327 | }); |
329 | 328 |
|
330 | | - it('language import 2', async () => { |
331 | | - this.timeout(10000); |
| 329 | + it('language import 2', { timeout: 10000 }, async () => { |
332 | 330 |
|
333 | 331 | const runResult = await helpers.run(appLocation).withAnswers({ |
334 | 332 | type: 'ext-language', |
@@ -379,8 +377,7 @@ describe('test code generator', function () { |
379 | 377 | } |
380 | 378 | }); |
381 | 379 |
|
382 | | - it('language new', async () => { |
383 | | - this.timeout(10000); |
| 380 | + it('language new', { timeout: 10000 }, async () => { |
384 | 381 |
|
385 | 382 | const runResult = await helpers.run(appLocation).withAnswers({ |
386 | 383 | type: 'ext-language', |
@@ -436,8 +433,7 @@ describe('test code generator', function () { |
436 | 433 | } |
437 | 434 | }); |
438 | 435 |
|
439 | | - it('snippet new', async () => { |
440 | | - this.timeout(10000); |
| 436 | + it('snippet new', { timeout: 10000 }, async () => { |
441 | 437 |
|
442 | 438 | const runResult = await helpers.run(appLocation).withAnswers({ |
443 | 439 | type: 'ext-snippets', |
@@ -478,8 +474,7 @@ describe('test code generator', function () { |
478 | 474 | } |
479 | 475 | }); |
480 | 476 |
|
481 | | - it('snippet import', async () => { |
482 | | - this.timeout(10000); |
| 477 | + it('snippet import', { timeout: 10000 }, async () => { |
483 | 478 |
|
484 | 479 | const runResult = await helpers.run(appLocation).withAnswers({ |
485 | 480 | type: 'ext-snippets', |
@@ -547,8 +542,7 @@ describe('test code generator', function () { |
547 | 542 | } |
548 | 543 | }); |
549 | 544 |
|
550 | | - it('keymap new', async () => { |
551 | | - this.timeout(10000); |
| 545 | + it('keymap new', { timeout: 10000 }, async () => { |
552 | 546 |
|
553 | 547 | const runResult = await helpers.run(appLocation).withAnswers({ |
554 | 548 | type: 'ext-keymap', |
@@ -587,8 +581,7 @@ describe('test code generator', function () { |
587 | 581 | } |
588 | 582 | }); |
589 | 583 |
|
590 | | - it('command-ts', async () => { |
591 | | - this.timeout(10000); |
| 584 | + it('command-ts', { timeout: 10000 }, async () => { |
592 | 585 |
|
593 | 586 | const runResult = await helpers.run(appLocation).withAnswers({ |
594 | 587 | type: 'ext-command-ts', |
@@ -650,8 +643,7 @@ describe('test code generator', function () { |
650 | 643 | } |
651 | 644 | }); |
652 | 645 |
|
653 | | - it('command-ts with yarn', async () => { |
654 | | - this.timeout(10000); |
| 646 | + it('command-ts with yarn', { timeout: 10000 }, async () => { |
655 | 647 |
|
656 | 648 | const runResult = await helpers.run(appLocation).withAnswers({ |
657 | 649 | type: 'ext-command-ts', |
@@ -730,8 +722,7 @@ describe('test code generator', function () { |
730 | 722 | } |
731 | 723 | }); |
732 | 724 |
|
733 | | - it('command-ts with pnpm', async () => { |
734 | | - this.timeout(10000); |
| 725 | + it('command-ts with pnpm', { timeout: 10000 }, async () => { |
735 | 726 |
|
736 | 727 | const runResult = await helpers.run(appLocation).withAnswers({ |
737 | 728 | type: 'ext-command-ts', |
@@ -810,8 +801,7 @@ describe('test code generator', function () { |
810 | 801 | } |
811 | 802 | }); |
812 | 803 |
|
813 | | - it('command-ts with webpack', async () => { |
814 | | - this.timeout(10000); |
| 804 | + it('command-ts with webpack', { timeout: 10000 }, async () => { |
815 | 805 |
|
816 | 806 | const runResult = await helpers.run(appLocation).withAnswers({ |
817 | 807 | type: 'ext-command-ts', |
@@ -880,8 +870,7 @@ describe('test code generator', function () { |
880 | 870 | } |
881 | 871 | }); |
882 | 872 |
|
883 | | - it('command-ts with webpack + pnpm', async () => { |
884 | | - this.timeout(10000); |
| 873 | + it('command-ts with webpack + pnpm', { timeout: 10000 }, async () => { |
885 | 874 |
|
886 | 875 | const runResult = await helpers.run(appLocation).withAnswers({ |
887 | 876 | type: 'ext-command-ts', |
@@ -950,8 +939,7 @@ describe('test code generator', function () { |
950 | 939 | } |
951 | 940 | }); |
952 | 941 |
|
953 | | - it('command-ts with esbuild + yarn', async () => { |
954 | | - this.timeout(10000); |
| 942 | + it('command-ts with esbuild + yarn', { timeout: 10000 }, async () => { |
955 | 943 |
|
956 | 944 | const runResult = await helpers.run(appLocation).withAnswers({ |
957 | 945 | type: 'ext-command-ts', |
@@ -1022,8 +1010,7 @@ describe('test code generator', function () { |
1022 | 1010 | } |
1023 | 1011 | }); |
1024 | 1012 |
|
1025 | | - it('command-js', async () => { |
1026 | | - this.timeout(10000); |
| 1013 | + it('command-js', { timeout: 10000 }, async () => { |
1027 | 1014 |
|
1028 | 1015 | const runResult = await helpers.run(appLocation).withAnswers({ |
1029 | 1016 | type: 'ext-command-js', |
@@ -1080,8 +1067,7 @@ describe('test code generator', function () { |
1080 | 1067 | } |
1081 | 1068 | }); |
1082 | 1069 |
|
1083 | | - it('command-js with pnpm', async () => { |
1084 | | - this.timeout(10000); |
| 1070 | + it('command-js with pnpm', { timeout: 10000 }, async () => { |
1085 | 1071 |
|
1086 | 1072 | const runResult = await helpers.run(appLocation).withAnswers({ |
1087 | 1073 | type: 'ext-command-js', |
@@ -1138,8 +1124,7 @@ describe('test code generator', function () { |
1138 | 1124 | } |
1139 | 1125 | }); |
1140 | 1126 |
|
1141 | | - it('command-js with check JS', async () => { |
1142 | | - this.timeout(10000); |
| 1127 | + it('command-js with check JS', { timeout: 10000 }, async () => { |
1143 | 1128 |
|
1144 | 1129 | const runResult = await helpers.run(appLocation).withAnswers({ |
1145 | 1130 | type: 'ext-command-js', |
@@ -1342,8 +1327,7 @@ describe('test code generator', function () { |
1342 | 1327 | } |
1343 | 1328 | }); |
1344 | 1329 |
|
1345 | | - it('command-web', async () => { |
1346 | | - this.timeout(10000); |
| 1330 | + it('command-web', { timeout: 10000 }, async () => { |
1347 | 1331 |
|
1348 | 1332 | const runResult = await helpers.run(appLocation).withAnswers({ |
1349 | 1333 | type: 'ext-command-web', |
@@ -1413,8 +1397,7 @@ describe('test code generator', function () { |
1413 | 1397 | } |
1414 | 1398 | }); |
1415 | 1399 |
|
1416 | | - it('command-web with pnpm', async () => { |
1417 | | - this.timeout(10000); |
| 1400 | + it('command-web with pnpm', { timeout: 10000 }, async () => { |
1418 | 1401 |
|
1419 | 1402 | const runResult = await helpers.run(appLocation).withAnswers({ |
1420 | 1403 | type: 'ext-command-web', |
@@ -1484,8 +1467,7 @@ describe('test code generator', function () { |
1484 | 1467 | } |
1485 | 1468 | }); |
1486 | 1469 |
|
1487 | | - it('command-web-esbuild with yarn', async () => { |
1488 | | - this.timeout(10000); |
| 1470 | + it('command-web-esbuild with yarn', { timeout: 10000 }, async () => { |
1489 | 1471 |
|
1490 | 1472 | const runResult = await helpers.run(appLocation).withAnswers({ |
1491 | 1473 | type: 'ext-command-web', |
|
0 commit comments