Skip to content

Commit

Permalink
fix(cli): Make tests work on npm 7 (#4297)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Mar 10, 2021
1 parent 959dd5b commit 676c907
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions cli/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ const APP_INDEX = `
</html>
`;

const APP_PACKAGE_JSON = `
{
"name": "test-app",
"dependencies": {
"${CORDOVA_PLUGIN_ID}": "latest"
}
}
`;

export async function installPlatform(
appDir: string,
platform: string,
Expand All @@ -102,6 +93,15 @@ export async function makeAppDir(monoRepoLike = false): Promise<void> {
if (monoRepoLike) {
await mkdir(rootDir);
}
const cordovaPluginPath = join(tmpDir, CORDOVA_PLUGIN_ID);
const APP_PACKAGE_JSON = `
{
"name": "test-app",
"dependencies": {
"${CORDOVA_PLUGIN_ID}": "file:${cordovaPluginPath}"
}
}
`;
const appDir = monoRepoLike ? join(rootDir, 'test-app') : rootDir;
await mkdir(appDir);
// Make the web dir
Expand All @@ -120,7 +120,6 @@ export async function makeAppDir(monoRepoLike = false): Promise<void> {
});

// Make a fake cordova plugin
const cordovaPluginPath = join(tmpDir, CORDOVA_PLUGIN_ID);
await makeCordovaPlugin(cordovaPluginPath);

await runCommand('npm', ['install', '--save', cordovaPluginPath], {
Expand Down

0 comments on commit 676c907

Please sign in to comment.