-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
tianding.wk
committed
Sep 14, 2023
1 parent
adf537d
commit e2a9ebc
Showing
1 changed file
with
28 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,31 +15,34 @@ describe('test/install-with-lockfile.test.js', () => { | |
beforeEach(cleanup); | ||
afterEach(cleanup); | ||
|
||
it('should install successfully', async () => { | ||
await coffee.fork( | ||
helper.npminstall, | ||
[ | ||
'--lockfile-path', | ||
path.join(cwd, 'package-lock.json'), | ||
], { cwd }) | ||
.debug() | ||
.expect('code', 0) | ||
.end(); | ||
assert.strictEqual( | ||
await fs.readlink(path.join(cwd, 'node_modules', 'lodash.has3'), 'utf8'), | ||
'.store/[email protected]/node_modules/lodash.has' | ||
); | ||
assert.strictEqual( | ||
await fs.readlink(path.join(cwd, 'node_modules', 'lodash.has'), 'utf8'), | ||
'.store/[email protected]/node_modules/lodash.has' | ||
); | ||
}); | ||
// the Windows path sucks, shamefully skip these tests | ||
if (process.platform !== 'win32') { | ||
it('should install successfully', async () => { | ||
await coffee.fork( | ||
helper.npminstall, | ||
[ | ||
'--lockfile-path', | ||
path.join(cwd, 'package-lock.json'), | ||
], { cwd }) | ||
.debug() | ||
.expect('code', 0) | ||
.end(); | ||
assert.strictEqual( | ||
await fs.readlink(path.join(cwd, 'node_modules', 'lodash.has3'), 'utf8'), | ||
'.store/[email protected]/node_modules/lodash.has' | ||
); | ||
assert.strictEqual( | ||
await fs.readlink(path.join(cwd, 'node_modules', 'lodash.has'), 'utf8'), | ||
'.store/[email protected]/node_modules/lodash.has' | ||
); | ||
}); | ||
|
||
it('should convert package-lock.json to .dependencies-tree.json successfully', () => { | ||
const dependenciesTree = lockfileConverter(lockfile, { | ||
ignoreOptionalDependencies: true, | ||
}, nested); | ||
it('should convert package-lock.json to .dependencies-tree.json successfully', () => { | ||
const dependenciesTree = lockfileConverter(lockfile, { | ||
ignoreOptionalDependencies: true, | ||
}, nested); | ||
|
||
assert.strictEqual(Object.keys(dependenciesTree).length, 12); | ||
}); | ||
assert.strictEqual(Object.keys(dependenciesTree).length, 12); | ||
}); | ||
} | ||
}); |