|
1 | 1 | import path from 'path';
|
2 | 2 | import test from 'ava';
|
3 |
| -import {outputJson, readJson, outputFile, readFile, pathExists} from 'fs-extra'; |
| 3 | +import {outputJson, readJson, outputFile, readFile, pathExists, appendFile} from 'fs-extra'; |
4 | 4 | import tempy from 'tempy';
|
5 | 5 | import execa from 'execa';
|
6 | 6 | import {stub} from 'sinon';
|
@@ -70,6 +70,7 @@ test('Updade package.json and package-lock.json', async t => {
|
70 | 70 | const packagePath = path.resolve(cwd, 'package.json');
|
71 | 71 | const packageLockPath = path.resolve(cwd, 'package-lock.json');
|
72 | 72 | await outputJson(packagePath, {version: '0.0.0-dev'});
|
| 73 | + await appendFile(path.resolve(cwd, '.npmrc'), 'package-lock = true'); |
73 | 74 | // Create a package-lock.json file
|
74 | 75 | await execa('npm', ['install'], {cwd});
|
75 | 76 |
|
@@ -126,6 +127,7 @@ test('Updade package.json and package-lock.json in a sub-directory', async t =>
|
126 | 127 | const packagePath = path.resolve(cwd, pkgRoot, 'package.json');
|
127 | 128 | const packageLockPath = path.resolve(cwd, pkgRoot, 'package-lock.json');
|
128 | 129 | await outputJson(packagePath, {version: '0.0.0-dev'});
|
| 130 | + await appendFile(path.resolve(cwd, pkgRoot, '.npmrc'), 'package-lock = true'); |
129 | 131 | // Create a package-lock.json file
|
130 | 132 | await execa('npm', ['install'], {cwd: path.resolve(cwd, pkgRoot)});
|
131 | 133 |
|
|
0 commit comments