Skip to content

Commit ff8abc7

Browse files
nx-cloud[bot]MaxKless
authored andcommitted
update test expectations for --ignore-scripts flag in npx commands wip
1 parent e9137a6 commit ff8abc7

File tree

5 files changed

+66
-44
lines changed

5 files changed

+66
-44
lines changed

packages/detox/src/generators/application/application.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ describe('detox application generator', () => {
360360
'android.local': {
361361
binaryPath: '../../my-dir/my-app/dist/MyDirMyApp.apk',
362362
build:
363-
'npx nx run my-dir-my-app:build --platform android --profile preview --wait --local --no-interactive --output=../../my-dir/my-app/dist/MyDirMyApp.apk',
363+
'npx --ignore-scripts nx run my-dir-my-app:build --platform android --profile preview --wait --local --no-interactive --output=../../my-dir/my-app/dist/MyDirMyApp.apk',
364364
type: 'android.apk',
365365
},
366366
'android.release': {
@@ -380,7 +380,7 @@ describe('detox application generator', () => {
380380
'ios.local': {
381381
binaryPath: '../../my-dir/my-app/dist/MyDirMyApp.app',
382382
build:
383-
'npx nx run my-dir-my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../../my-dir/my-app/dist/MyDirMyApp.tar.gz',
383+
'npx --ignore-scripts nx run my-dir-my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../../my-dir/my-app/dist/MyDirMyApp.tar.gz',
384384
type: 'ios.app',
385385
},
386386
'ios.release': {

packages/expo/src/generators/application/application.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe('app', () => {
178178
'android.local': {
179179
binaryPath: '../my-dir/dist/MyApp.apk',
180180
build:
181-
'npx nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-dir/dist/MyApp.apk',
181+
'npx --ignore-scripts nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-dir/dist/MyApp.apk',
182182
type: 'android.apk',
183183
},
184184
'android.release': {
@@ -198,7 +198,7 @@ describe('app', () => {
198198
'ios.local': {
199199
binaryPath: '../my-dir/dist/MyApp.app',
200200
build:
201-
'npx nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-dir/dist/MyApp.tar.gz',
201+
'npx --ignore-scripts nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-dir/dist/MyApp.tar.gz',
202202
type: 'ios.app',
203203
},
204204
'ios.release': {
@@ -238,7 +238,7 @@ describe('app', () => {
238238
'android.local': {
239239
binaryPath: '../my-app/dist/MyApp.apk',
240240
build:
241-
'npx nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-app/dist/MyApp.apk',
241+
'npx --ignore-scripts nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-app/dist/MyApp.apk',
242242
type: 'android.apk',
243243
},
244244
'android.release': {
@@ -258,7 +258,7 @@ describe('app', () => {
258258
'ios.local': {
259259
binaryPath: '../my-app/dist/MyApp.app',
260260
build:
261-
'npx nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-app/dist/MyApp.tar.gz',
261+
'npx --ignore-scripts nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-app/dist/MyApp.tar.gz',
262262
type: 'ios.app',
263263
},
264264
'ios.release': {
@@ -302,7 +302,7 @@ describe('app', () => {
302302
'android.local': {
303303
binaryPath: '../my-app/dist/myappname.apk',
304304
build:
305-
'npx nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-app/dist/myappname.apk',
305+
'npx --ignore-scripts nx run my-app:build --platform android --profile preview --wait --local --no-interactive --output=../my-app/dist/myappname.apk',
306306
type: 'android.apk',
307307
},
308308
'android.release': {
@@ -322,7 +322,7 @@ describe('app', () => {
322322
'ios.local': {
323323
binaryPath: '../my-app/dist/myappname.app',
324324
build:
325-
'npx nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-app/dist/myappname.tar.gz',
325+
'npx --ignore-scripts nx run my-app:build --platform ios --profile preview --wait --local --no-interactive --output=../my-app/dist/myappname.tar.gz',
326326
type: 'ios.app',
327327
},
328328
'ios.release': {

packages/jest/src/plugins/plugin.spec.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
8484
"metadata": {
8585
"description": "Run Jest Tests",
8686
"help": {
87-
"command": "npx jest --help",
87+
"command": "npx --ignore-scripts jest --help",
8888
"example": {
8989
"options": {
9090
"coverage": true,
@@ -165,7 +165,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
165165
"metadata": {
166166
"description": "Run Jest Tests",
167167
"help": {
168-
"command": "npx jest --help",
168+
"command": "npx --ignore-scripts jest --help",
169169
"example": {
170170
"options": {
171171
"coverage": true,
@@ -204,7 +204,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
204204
"metadata": {
205205
"description": "Run Jest Tests in CI",
206206
"help": {
207-
"command": "npx jest --help",
207+
"command": "npx --ignore-scripts jest --help",
208208
"example": {
209209
"options": {
210210
"coverage": true,
@@ -235,7 +235,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
235235
"metadata": {
236236
"description": "Run Jest Tests in src/unit.spec.ts",
237237
"help": {
238-
"command": "npx jest --help",
238+
"command": "npx --ignore-scripts jest --help",
239239
"example": {
240240
"options": {
241241
"coverage": true,
@@ -304,7 +304,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
304304
"metadata": {
305305
"description": "Run Jest Tests",
306306
"help": {
307-
"command": "npx jest --help",
307+
"command": "npx --ignore-scripts jest --help",
308308
"example": {
309309
"options": {
310310
"coverage": true,
@@ -384,7 +384,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
384384
"metadata": {
385385
"description": "Run Jest Tests",
386386
"help": {
387-
"command": "npx jest --help",
387+
"command": "npx --ignore-scripts jest --help",
388388
"example": {
389389
"options": {
390390
"coverage": true,
@@ -468,7 +468,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
468468
"metadata": {
469469
"description": "Run Jest Tests",
470470
"help": {
471-
"command": "npx jest --help",
471+
"command": "npx --ignore-scripts jest --help",
472472
"example": {
473473
"options": {
474474
"coverage": true,
@@ -507,7 +507,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
507507
"metadata": {
508508
"description": "Run Jest Tests in CI",
509509
"help": {
510-
"command": "npx jest --help",
510+
"command": "npx --ignore-scripts jest --help",
511511
"example": {
512512
"options": {
513513
"coverage": true,
@@ -538,7 +538,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
538538
"metadata": {
539539
"description": "Run Jest Tests in src/unit.spec.ts",
540540
"help": {
541-
"command": "npx jest --help",
541+
"command": "npx --ignore-scripts jest --help",
542542
"example": {
543543
"options": {
544544
"coverage": true,
@@ -618,7 +618,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
618618
"metadata": {
619619
"description": "Run Jest Tests",
620620
"help": {
621-
"command": "npx jest --help",
621+
"command": "npx --ignore-scripts jest --help",
622622
"example": {
623623
"options": {
624624
"coverage": true,
@@ -657,7 +657,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
657657
"metadata": {
658658
"description": "Run Jest Tests in CI",
659659
"help": {
660-
"command": "npx jest --help",
660+
"command": "npx --ignore-scripts jest --help",
661661
"example": {
662662
"options": {
663663
"coverage": true,
@@ -688,7 +688,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
688688
"metadata": {
689689
"description": "Run Jest Tests in src/unit.spec.ts",
690690
"help": {
691-
"command": "npx jest --help",
691+
"command": "npx --ignore-scripts jest --help",
692692
"example": {
693693
"options": {
694694
"coverage": true,
@@ -768,7 +768,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
768768
"metadata": {
769769
"description": "Run Jest Tests",
770770
"help": {
771-
"command": "npx jest --help",
771+
"command": "npx --ignore-scripts jest --help",
772772
"example": {
773773
"options": {
774774
"coverage": true,
@@ -807,7 +807,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
807807
"metadata": {
808808
"description": "Run Jest Tests in CI",
809809
"help": {
810-
"command": "npx jest --help",
810+
"command": "npx --ignore-scripts jest --help",
811811
"example": {
812812
"options": {
813813
"coverage": true,
@@ -838,7 +838,7 @@ describe.each([true, false])('@nx/jest/plugin', (disableJestRuntime) => {
838838
"metadata": {
839839
"description": "Run Jest Tests in src/unit.spec.ts",
840840
"help": {
841-
"command": "npx jest --help",
841+
"command": "npx --ignore-scripts jest --help",
842842
"example": {
843843
"options": {
844844
"coverage": true,

packages/nx/src/utils/provenance.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { execFile } from 'child_process';
22
import { promisify } from 'util';
33

4+
/*
5+
* Verifies that the given npm package has provenance attestations
6+
* generated by the GitHub Actions workflow at .github/workflows/publish.yml
7+
* in the nrwl/nx repository.
8+
*
9+
* Will throw if the package does not have valid provenance.
10+
*/
411
export async function ensurePackageHasProvenance(
512
packageName: string,
613
packageVersion: string
@@ -17,7 +24,7 @@ export async function ensurePackageHasProvenance(
1724
(
1825
await execFileAsync(
1926
'npm',
20-
['view', `${packageName}@${packageVersion}`, '--json'],
27+
['view', `${packageName}@${packageVersion}`, '--json', '--silent'],
2128
{
2229
timeout: 20000,
2330
}

packages/react-native/src/migrations/update-21-4-0/upgrade-react-native-projects.spec.ts

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,13 @@ describe('upgrade-react-native-projects', () => {
163163

164164
await update(tree);
165165

166-
expect(execSync).toHaveBeenCalledWith('npx nx upgrade mobile-app', {
167-
stdio: 'inherit',
168-
cwd: process.cwd(),
169-
});
166+
expect(execSync).toHaveBeenCalledWith(
167+
'npx --ignore-scripts nx upgrade mobile-app',
168+
{
169+
stdio: 'inherit',
170+
cwd: process.cwd(),
171+
}
172+
);
170173
expect(execSync).toHaveBeenCalledTimes(1);
171174
});
172175

@@ -177,14 +180,20 @@ describe('upgrade-react-native-projects', () => {
177180

178181
await update(tree);
179182

180-
expect(execSync).toHaveBeenCalledWith('npx nx upgrade mobile-app-1', {
181-
stdio: 'inherit',
182-
cwd: process.cwd(),
183-
});
184-
expect(execSync).toHaveBeenCalledWith('npx nx upgrade mobile-app-2', {
185-
stdio: 'inherit',
186-
cwd: process.cwd(),
187-
});
183+
expect(execSync).toHaveBeenCalledWith(
184+
'npx --ignore-scripts nx upgrade mobile-app-1',
185+
{
186+
stdio: 'inherit',
187+
cwd: process.cwd(),
188+
}
189+
);
190+
expect(execSync).toHaveBeenCalledWith(
191+
'npx --ignore-scripts nx upgrade mobile-app-2',
192+
{
193+
stdio: 'inherit',
194+
cwd: process.cwd(),
195+
}
196+
);
188197
expect(execSync).toHaveBeenCalledTimes(2);
189198
});
190199

@@ -274,10 +283,13 @@ describe('upgrade-react-native-projects', () => {
274283

275284
await update(tree);
276285

277-
expect(execSync).toHaveBeenCalledWith('npx nx upgrade rn-config-js', {
278-
stdio: 'inherit',
279-
cwd: process.cwd(),
280-
});
286+
expect(execSync).toHaveBeenCalledWith(
287+
'npx --ignore-scripts nx upgrade rn-config-js',
288+
{
289+
stdio: 'inherit',
290+
cwd: process.cwd(),
291+
}
292+
);
281293
expect(execSync).toHaveBeenCalledTimes(1);
282294
});
283295

@@ -304,10 +316,13 @@ describe('upgrade-react-native-projects', () => {
304316

305317
await update(tree);
306318

307-
expect(execSync).toHaveBeenCalledWith('npx nx upgrade rn-config-ts', {
308-
stdio: 'inherit',
309-
cwd: process.cwd(),
310-
});
319+
expect(execSync).toHaveBeenCalledWith(
320+
'npx --ignore-scripts nx upgrade rn-config-ts',
321+
{
322+
stdio: 'inherit',
323+
cwd: process.cwd(),
324+
}
325+
);
311326
expect(execSync).toHaveBeenCalledTimes(1);
312327
});
313328
});

0 commit comments

Comments
 (0)