|
1 | 1 | import * as ts from "../../_namespaces/ts";
|
2 | 2 | import * as Utils from "../../_namespaces/Utils";
|
| 3 | +import { libContent } from "../tsc/helpers"; |
3 | 4 | import {
|
4 | 5 | createWatchedSystem,
|
5 | 6 | File,
|
@@ -621,4 +622,64 @@ declare namespace NodeJS {
|
621 | 622 | },
|
622 | 623 | ]
|
623 | 624 | });
|
| 625 | + |
| 626 | + verifyTscWatch({ |
| 627 | + scenario, |
| 628 | + subScenario: "scoped package installation", |
| 629 | + commandLineArgs: ["--w", "-p", `.`, "--traceResolution", "--extendedDiagnostics"], |
| 630 | + sys: () => createWatchedSystem({ |
| 631 | + "/user/username/projects/myproject/lib/app.ts": Utils.dedent` |
| 632 | + import { myapp } from "@myapp/ts-types"; |
| 633 | + const x: 10 = myapp; |
| 634 | + `, |
| 635 | + "/user/username/projects/myproject/tsconfig.json": "{}", |
| 636 | + [libFile.path]: libContent, |
| 637 | + }, { currentDirectory: "/user/username/projects/myproject" }), |
| 638 | + edits: [ |
| 639 | + { |
| 640 | + caption: "npm install unrelated non scoped", |
| 641 | + edit: sys => sys.ensureFileOrFolder({ |
| 642 | + path: `/user/username/projects/myproject/node_modules/unrelated/index.d.ts`, |
| 643 | + content: `export const unrelated = 10;` |
| 644 | + }), |
| 645 | + timeouts: sys => { |
| 646 | + sys.runQueuedTimeoutCallbacks(); |
| 647 | + sys.runQueuedTimeoutCallbacks(); |
| 648 | + }, |
| 649 | + }, |
| 650 | + { |
| 651 | + caption: "npm install unrelated scoped in myapp", |
| 652 | + edit: sys => sys.ensureFileOrFolder({ |
| 653 | + path: `/user/username/projects/myproject/node_modules/@myapp/unrelated/index.d.ts`, |
| 654 | + content: `export const myappUnrelated = 10;` |
| 655 | + }), |
| 656 | + timeouts: sys => { |
| 657 | + sys.runQueuedTimeoutCallbacks(); |
| 658 | + sys.runQueuedTimeoutCallbacks(); |
| 659 | + }, |
| 660 | + }, |
| 661 | + { |
| 662 | + caption: "npm install unrelated2 scoped in myapp", |
| 663 | + edit: sys => sys.ensureFileOrFolder({ |
| 664 | + path: `/user/username/projects/myproject/node_modules/@myapp/unrelated2/index.d.ts`, |
| 665 | + content: `export const myappUnrelated2 = 10;` |
| 666 | + }), |
| 667 | + timeouts: sys => { |
| 668 | + sys.runQueuedTimeoutCallbacks(); |
| 669 | + sys.runQueuedTimeoutCallbacks(); |
| 670 | + }, |
| 671 | + }, |
| 672 | + { |
| 673 | + caption: "npm install ts-types", |
| 674 | + edit: sys => sys.ensureFileOrFolder({ |
| 675 | + path: `/user/username/projects/myproject/node_modules/@myapp/ts-types/index.d.ts`, |
| 676 | + content: `export const myapp = 10;` |
| 677 | + }), |
| 678 | + timeouts: sys => { |
| 679 | + sys.runQueuedTimeoutCallbacks(); |
| 680 | + sys.runQueuedTimeoutCallbacks(); |
| 681 | + }, |
| 682 | + }, |
| 683 | + ] |
| 684 | + }); |
624 | 685 | });
|
0 commit comments