Skip to content

Commit 4ac6a0b

Browse files
committed
test: update snapshots for task execution logs and context
1 parent 4e92eba commit 4ac6a0b

13 files changed

+54
-213
lines changed

packages/nadle/test/__snapshots__/builtin-tasks/copy-task.test.ts.snap

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,3 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer copyWithFilter
7676
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
7777
[log] <Bold>1</BoldDim> task executed
7878
`;
79-
80-
exports[`copyTask > with include and exclude options > copies only matching files 3`] = `
81-
---------- Context -----------
82-
Working Directory: /ROOT/test/__fixtures__/copy-task/__temp__/__{hash}__
83-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer copyWithFilter
84-
---------- Stdout ------------
85-
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
86-
[log] Using Nadle from /ROOT/lib/index.js
87-
[log] Loaded configuration from /ROOT/test/__fixtures__/copy-task/__temp__/__{hash}__/nadle.config.ts
88-
89-
[log] <Yellow>></Yellow> Task <Bold>copyWithFilter</BoldDim> <Yellow>STARTED</Yellow>
90-
91-
[log] Copy assets/sub/baz.txt -> dist/sub/baz.txt
92-
[log]
93-
<Green>✓</Green> Task <Bold>copyWithFilter</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
94-
[log]
95-
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
96-
[log] <Bold>1</BoldDim> task executed
97-
`;

packages/nadle/test/__snapshots__/builtin-tasks/delete-task.test.ts.snap

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,3 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer deleteFilesFooBar
165165
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
166166
[log] <Bold>1</BoldDim> task executed
167167
`;
168-
169-
exports[`deleteTask > given multiple file paths > can delete them 3`] = `
170-
---------- Context -----------
171-
Working Directory: /ROOT/test/__fixtures__/delete-task/__temp__/__{hash}__
172-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer deleteFilesFooBar
173-
---------- Stdout ------------
174-
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
175-
[log] Using Nadle from /ROOT/lib/index.js
176-
[log] Loaded configuration from /ROOT/test/__fixtures__/delete-task/__temp__/__{hash}__/nadle.config.ts
177-
178-
[log] <Yellow>></Yellow> Task <Bold>deleteFilesFooBar</BoldDim> <Yellow>STARTED</Yellow>
179-
180-
[log]
181-
<Green>✓</Green> Task <Bold>deleteFilesFooBar</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
182-
[log]
183-
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
184-
[log] <Bold>1</BoldDim> task executed
185-
`;

packages/nadle/test/__snapshots__/builtin-tasks/npm-task.test.ts.snap

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -119,29 +119,3 @@ Found 1 error.
119119
[log]
120120
For more details, re-run the command with the <Yellow>--stacktrace</Yellow> option to display the full error and help identify the root cause.
121121
`;
122-
123-
exports[`npm Task > throw error when running tsc command with error ts file 2`] = `
124-
---------- Context -----------
125-
Working Directory: /ROOT/test/__fixtures__/npm-task
126-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer fail
127-
---------- Stdout ------------
128-
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
129-
[log] Using Nadle from /ROOT/lib/index.js
130-
[log] Loaded configuration from /ROOT/test/__fixtures__/npm-task/nadle.config.ts
131-
132-
[log] <Yellow>></Yellow> Task <Bold>fail</BoldDim> <Yellow>STARTED</Yellow>
133-
134-
[log] <BrightRed>error</Reset><BrightBlack> TS6053: </Reset>File 'src/nonexistent.ts' not found.
135-
The file is in the program because:
136-
Root file specified for compilation
137-
138-
[log]
139-
Found 1 error.
140-
141-
[log]
142-
<Red>×</Red> Task <Bold>fail</BoldDim> <Red>FAILED</Red> {duration}
143-
[log]
144-
<Bold><Red>RUN FAILED</Red></BoldDim> in <Bold>{duration}</BoldDim> <Dim>(<Bold>0</BoldDim><Dim> task executed, <Bold>1</BoldDim><Dim> task failed)</BoldDim>
145-
[log]
146-
For more details, re-run the command with the <Yellow>--stacktrace</Yellow> option to display the full error and help identify the root cause.
147-
`;

packages/nadle/test/__snapshots__/builtin-tasks/npx-task.test.ts.snap

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -119,29 +119,3 @@ Found 1 error.
119119
[log]
120120
For more details, re-run the command with the <Yellow>--stacktrace</Yellow> option to display the full error and help identify the root cause.
121121
`;
122-
123-
exports[`npx Task > throw error when running tsc command with error ts file 2`] = `
124-
---------- Context -----------
125-
Working Directory: /ROOT/test/__fixtures__/npx-task
126-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer fail
127-
---------- Stdout ------------
128-
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
129-
[log] Using Nadle from /ROOT/lib/index.js
130-
[log] Loaded configuration from /ROOT/test/__fixtures__/npx-task/nadle.config.ts
131-
132-
[log] <Yellow>></Yellow> Task <Bold>fail</BoldDim> <Yellow>STARTED</Yellow>
133-
134-
[log] <BrightRed>error</Reset><BrightBlack> TS6053: </Reset>File 'src/nonexistent.ts' not found.
135-
The file is in the program because:
136-
Root file specified for compilation
137-
138-
[log]
139-
Found 1 error.
140-
141-
[log]
142-
<Red>×</Red> Task <Bold>fail</BoldDim> <Red>FAILED</Red> {duration}
143-
[log]
144-
<Bold><Red>RUN FAILED</Red></BoldDim> in <Bold>{duration}</BoldDim> <Dim>(<Bold>0</BoldDim><Dim> task executed, <Bold>1</BoldDim><Dim> task failed)</BoldDim>
145-
[log]
146-
For more details, re-run the command with the <Yellow>--stacktrace</Yellow> option to display the full error and help identify the root cause.
147-
`;

packages/nadle/test/__snapshots__/builtin-tasks/pnpm-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer pass --log-level info
6464
[info] Detected environments: { CI: false, TEST: true }
6565
[info] Execution started
6666
[info] Scheduled tasks: root:pass
67+
[info] Running pnpm command: pnpm exec tsc ./src/pass.ts --noEmit --pretty
6768
[log] <Yellow>></Yellow> Task <Bold>pass</BoldDim> <Yellow>STARTED</Yellow>
6869
69-
[info] Running pnpm command: pnpm exec tsc ./src/pass.ts --noEmit --pretty
7070
[info] pnpm command completed successfully.
7171
[log]
7272
<Green>✓</Green> Task <Bold>pass</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>

packages/nadle/test/__snapshots__/features/graceful-cancellation.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Command: /ROOT/nadle.mjs --no-footer main-task --max-workers 2
99
[log] Using Nadle from /ROOT/lib/index.js
1010
[log] Loaded configuration from /ROOT/test/__temp__/__{hash}__/nadle.config.ts
1111
12-
[log] <Yellow>></Yellow> Task <Bold>success-task</BoldDim> <Yellow>STARTED</Yellow>
13-
1412
[log] <Yellow>></Yellow> Task <Bold>fail-task</BoldDim> <Yellow>STARTED</Yellow>
1513
14+
[log] <Yellow>></Yellow> Task <Bold>success-task</BoldDim> <Yellow>STARTED</Yellow>
15+
1616
[log]
1717
<Red>×</Red> Task <Bold>fail-task</BoldDim> <Red>FAILED</Red> {duration}
1818
[log]

packages/nadle/test/__snapshots__/features/profiling-summary.test.ts.snap

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/nadle/test/__snapshots__/features/workspaces/workspaces-alias.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer build
1414
Build one
1515
[log]
1616
<Green>✓</Green> Task <Bold>packages:one:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
17+
Build two
1718
[log] <Yellow>></Yellow> Task <Bold>two:build</BoldDim> <Yellow>STARTED</Yellow>
1819
19-
Build two
2020
[log]
2121
<Green>✓</Green> Task <Bold>two:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
2222
[log] <Yellow>></Yellow> Task <Bold>build</BoldDim> <Yellow>STARTED</Yellow>

packages/nadle/test/__snapshots__/features/workspaces/workspaces-basic-tasks.test.ts.snap

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,6 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer --list
2424
exports[`workspaces basic tasks > when running a task from a workspace > with specifying workspace explicitly > when the task is defined in the workspace > should run the that task 1`] = `
2525
---------- Context -----------
2626
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
27-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer root:build
28-
---------- Stdout ------------
29-
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
30-
[log] Using Nadle from /ROOT/lib/index.js
31-
[log] Loaded configuration from /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/nadle.config.ts and 3 other(s) files
32-
33-
[log] <Yellow>></Yellow> Task <Bold>packages:one:build</BoldDim> <Yellow>STARTED</Yellow>
34-
35-
Build one
36-
[log]
37-
<Green>✓</Green> Task <Bold>packages:one:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
38-
[log] <Yellow>></Yellow> Task <Bold>packages:three:build</BoldDim> <Yellow>STARTED</Yellow>
39-
40-
Build three
41-
[log]
42-
<Green>✓</Green> Task <Bold>packages:three:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
43-
[log] <Yellow>></Yellow> Task <Bold>packages:two:build</BoldDim> <Yellow>STARTED</Yellow>
44-
45-
Build two
46-
[log]
47-
<Green>✓</Green> Task <Bold>packages:two:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
48-
[log] <Yellow>></Yellow> Task <Bold>build</BoldDim> <Yellow>STARTED</Yellow>
49-
50-
Build root
51-
[log]
52-
<Green>✓</Green> Task <Bold>build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
53-
[log]
54-
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
55-
[log] <Bold>4</BoldDim> tasks executed
56-
`;
57-
58-
exports[`workspaces basic tasks > when running a task from a workspace > with specifying workspace explicitly > when the task is defined in the workspace > should run the that task 2`] = `
59-
---------- Context -----------
60-
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
6127
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer packages:two:build
6228
---------- Stdout ------------
6329
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
@@ -74,7 +40,7 @@ Build two
7440
[log] <Bold>1</BoldDim> task executed
7541
`;
7642

77-
exports[`workspaces basic tasks > when running a task from a workspace > with specifying workspace explicitly > when the task is defined in the workspace > should run the that task 3`] = `
43+
exports[`workspaces basic tasks > when running a task from a workspace > with specifying workspace explicitly > when the task is defined in the workspace > should run the that task 2`] = `
7844
---------- Context -----------
7945
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
8046
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer root:build
@@ -197,19 +163,19 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer build
197163
Build one
198164
[log]
199165
<Green>✓</Green> Task <Bold>packages:one:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
200-
Build three
201166
[log] <Yellow>></Yellow> Task <Bold>packages:three:build</BoldDim> <Yellow>STARTED</Yellow>
202167
168+
Build three
203169
[log]
204170
<Green>✓</Green> Task <Bold>packages:three:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
205171
[log] <Yellow>></Yellow> Task <Bold>packages:two:build</BoldDim> <Yellow>STARTED</Yellow>
206172
207173
Build two
208174
[log]
209175
<Green>✓</Green> Task <Bold>packages:two:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
210-
Build root
211176
[log] <Yellow>></Yellow> Task <Bold>build</BoldDim> <Yellow>STARTED</Yellow>
212177
178+
Build root
213179
[log]
214180
<Green>✓</Green> Task <Bold>build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
215181
[log]

packages/nadle/test/__snapshots__/features/workspaces/workspaces-excluded-tasks.test.ts.snap

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,35 @@
33
exports[`workspaces > excluded tasks > should not run excluded tasks 1`] = `
44
---------- Context -----------
55
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
6+
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer check --exclude build
7+
---------- Stdout ------------
8+
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
9+
[log] Using Nadle from /ROOT/lib/index.js
10+
[log] Loaded configuration from /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/nadle.config.ts and 2 other(s) files
11+
12+
[log] <Yellow>></Yellow> Task <Bold>two:build</BoldDim> <Yellow>STARTED</Yellow>
13+
14+
Build one
15+
[log]
16+
<Green>✓</Green> Task <Bold>two:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
17+
[log] <Yellow>></Yellow> Task <Bold>build</BoldDim> <Yellow>STARTED</Yellow>
18+
19+
Build root
20+
[log]
21+
<Green>✓</Green> Task <Bold>build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
22+
[log] <Yellow>></Yellow> Task <Bold>packages:one:check</BoldDim> <Yellow>STARTED</Yellow>
23+
24+
Check one
25+
[log]
26+
<Green>✓</Green> Task <Bold>packages:one:check</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
27+
[log]
28+
<Bold><Green>RUN SUCCESSFUL</Green></BoldDim> in <Bold>{duration}</BoldDim>
29+
[log] <Bold>3</BoldDim> tasks executed
30+
`;
31+
32+
exports[`workspaces > excluded tasks > should not run excluded tasks 2`] = `
33+
---------- Context -----------
34+
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
635
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer check --exclude two:build
736
---------- Stdout ------------
837
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
@@ -32,20 +61,20 @@ Check one
3261
[log] <Bold>3</BoldDim> tasks executed
3362
`;
3463

35-
exports[`workspaces > excluded tasks > should not run excluded tasks 2`] = `
64+
exports[`workspaces > excluded tasks > should not run excluded tasks 3`] = `
3665
---------- Context -----------
3766
Working Directory: /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/packages/one
38-
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer check --exclude build
67+
Command: /ROOT/nadle.mjs --max-workers 1 --no-footer check --exclude packages:two:build
3968
---------- Stdout ------------
4069
[log] <Bold><Cyan>🛠️ Welcome to Nadle {version}!</Cyan></BoldDim>
4170
[log] Using Nadle from /ROOT/lib/index.js
4271
[log] Loaded configuration from /ROOT/test/__fixtures__/monorepo/__temp__/__{hash}__/nadle.config.ts and 2 other(s) files
4372
44-
[log] <Yellow>></Yellow> Task <Bold>two:build</BoldDim> <Yellow>STARTED</Yellow>
73+
[log] <Yellow>></Yellow> Task <Bold>packages:one:build</BoldDim> <Yellow>STARTED</Yellow>
4574
4675
Build one
4776
[log]
48-
<Green>✓</Green> Task <Bold>two:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
77+
<Green>✓</Green> Task <Bold>packages:one:build</BoldDim> <Green>DONE</Green> <Dim>{duration}</BoldDim>
4978
[log] <Yellow>></Yellow> Task <Bold>build</BoldDim> <Yellow>STARTED</Yellow>
5079
5180
Build root

0 commit comments

Comments
 (0)