-
Notifications
You must be signed in to change notification settings - Fork 12k
test: add local npm registry to failing tests #15173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,13 @@ export default async function () { | |
} | ||
|
||
const startCwd = process.cwd(); | ||
await silentNpm('install', '-g', packages['@angular-devkit/schematics-cli'].tar, '--unsafe-perm'); | ||
await silentNpm( | ||
'install', | ||
'-g', | ||
packages['@angular-devkit/schematics-cli'].tar, | ||
'--unsafe-perm', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here for the package name. |
||
'--registry=http://localhost:4873', | ||
); | ||
await exec(process.platform.startsWith('win') ? 'where' : 'which', 'schematics'); | ||
|
||
// create blank schematic | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ import {join} from 'path'; | |
import * as glob from 'glob'; | ||
import {getGlobalVariable} from './env'; | ||
import {relative} from 'path'; | ||
import {copyFile} from './fs'; | ||
import {copyFile, writeFile} from './fs'; | ||
import {useBuiltPackages} from './project'; | ||
import { git, silentNpm } from './process'; | ||
|
||
|
@@ -39,10 +39,12 @@ export function copyAssets(assetName: string) { | |
} | ||
|
||
|
||
export function createProjectFromAsset(assetName: string, useNpmPackages = false) { | ||
return Promise.resolve() | ||
.then(() => copyAssets(assetName)) | ||
.then(dir => process.chdir(dir)) | ||
.then(() => useNpmPackages ? null : useBuiltPackages()) | ||
.then(() => silentNpm('install')); | ||
export async function createProjectFromAsset(assetName: string, useNpmPackages = false) { | ||
const dir = await copyAssets(assetName); | ||
process.chdir(dir); | ||
if (!useNpmPackages) { | ||
await useBuiltPackages(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically, no test should be using the built packages directly anymore but this fixes the problem for now. We should revisit these tests though. Potentially using |
||
await writeFile('.npmrc', 'registry = http://localhost:4873', 'utf8'); | ||
} | ||
await silentNpm('install'); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.