-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Expand file tree
/
Copy pathyarn-env-vars.ts
More file actions
29 lines (26 loc) · 1.05 KB
/
yarn-env-vars.ts
File metadata and controls
29 lines (26 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { expectFileNotToExist, expectFileToExist } from '../../../utils/fs';
import { getActivePackageManager } from '../../../utils/packages';
import { git, ng } from '../../../utils/process';
import {
createNpmConfigForAuthentication,
setNpmEnvVarsForAuthentication,
} from '../../../utils/registry';
export default async function () {
// Yarn specific test that tests YARN_ env variables.
// https://classic.yarnpkg.com/en/docs/envvars/
if (getActivePackageManager() !== 'yarn') {
return;
}
const command = ['add', '@angular/pwa', '--skip-confirmation'];
// Environment variables only
await expectFileNotToExist('public/manifest.webmanifest');
setNpmEnvVarsForAuthentication(false, true);
await ng(...command);
await expectFileToExist('public/manifest.webmanifest');
await git('clean', '-dxf');
// Mix of config file and env vars works
await expectFileNotToExist('public/manifest.webmanifest');
await createNpmConfigForAuthentication(false, true);
await ng(...command);
await expectFileToExist('public/manifest.webmanifest');
}