Skip to content

Commit c739307

Browse files
test: separate NUTs
1 parent a41c487 commit c739307

File tree

3 files changed

+33
-10
lines changed

3 files changed

+33
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"prepack": "sf-prepack",
114114
"prepare": "sf-install",
115115
"test": "wireit",
116-
"test:nuts": "node --loader ts-node/esm ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 10",
116+
"test:nuts": "node --loader ts-node/esm ./test/nuts/generateNuts.ts && nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 1200000 --retries 0 --jobs 10",
117117
"test:nuts:convert": "nyc mocha \"test/nuts/convert/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
118118
"test:nuts:deb": "nyc mocha \"test/nuts/digitalExperienceBundle/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",
119119
"test:nuts:delete": "nyc mocha \"test/nuts/delete/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --retries 0 --jobs 20",

test/commands/deploy/metadata.nut.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
import { fileURLToPath } from 'node:url';
99
import { SourceTestkit } from '@salesforce/source-testkit';
10-
import { execCmd } from '@salesforce/cli-plugins-testkit';
11-
import { expect } from 'chai';
12-
import { type DeployResultJson } from '../../../src/utils/types.js';
1310

1411
describe('deploy metadata NUTs', () => {
1512
let testkit: SourceTestkit;
@@ -30,12 +27,6 @@ describe('deploy metadata NUTs', () => {
3027
await testkit.deploy({ args: '--source-dir force-app' });
3128
await testkit.expect.filesToBeDeployed(['force-app/**/*'], ['force-app/test/**/*']);
3229
});
33-
34-
it('--source-dir --dry-run should NOT affect source-tracking', async () => {
35-
execCmd('project:deploy:start --dry-run --source-dir force-app', { ensureExitCode: 0 });
36-
const actual = execCmd<DeployResultJson>('project:deploy:start --json', { ensureExitCode: 0 }).jsonOutput; // should deploy everything since previous attempt was --dry-run
37-
expect(actual?.result?.numberComponentsDeployed).to.be.greaterThan(1);
38-
});
3930
});
4031

4132
describe('--metadata flag', () => {

test/nuts/deploy/start.nut.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2023, salesforce.com, inc.
3+
* All rights reserved.
4+
* Licensed under the BSD 3-Clause license.
5+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6+
*/
7+
import { fileURLToPath } from 'node:url';
8+
import { execCmd } from '@salesforce/cli-plugins-testkit';
9+
import { expect } from 'chai';
10+
import { SourceTestkit } from '@salesforce/source-testkit';
11+
import { DeployResultJson } from '../../../src/utils/types.js';
12+
13+
describe('project deploy start NUTs', () => {
14+
let testkit: SourceTestkit;
15+
16+
before(async () => {
17+
testkit = await SourceTestkit.create({
18+
repository: 'https://github.com/trailheadapps/dreamhouse-lwc.git',
19+
nut: fileURLToPath(import.meta.url),
20+
});
21+
});
22+
23+
after(async () => {
24+
await testkit?.clean();
25+
});
26+
27+
it('--source-dir --dry-run should NOT affect source-tracking', async () => {
28+
execCmd('project:deploy:start --dry-run --source-dir force-app', { ensureExitCode: 0 });
29+
const actual = execCmd<DeployResultJson>('project:deploy:start --json', { ensureExitCode: 0 }).jsonOutput; // should deploy everything since previous attempt was --dry-run
30+
expect(actual?.result?.numberComponentsDeployed).to.be.greaterThan(1);
31+
});
32+
});

0 commit comments

Comments
 (0)