Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite914854

Browse files
committed
test: Add simple test for NPM use
1 parent2016dff commite914854

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎tests/utils.spec.js‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import{toBool,getDeltaText,iconForDifference,diffTable,fileExists,stripHash}from'../src/utils.js';
1+
importpathfrom'path';
2+
import{toBool,getDeltaText,iconForDifference,diffTable,getPackageManagerAndInstallScript,fileExists,stripHash}from'../src/utils.js';
23

34
test('toBool',()=>{
45
expect(toBool('1')).toBe(true);
@@ -65,6 +66,18 @@ test('diffTable', () => {
6566
expect(diffTable([files[2]],{ ...defaultOptions})).toMatchSnapshot();
6667
});
6768

69+
test('getPackageManagerAndInstallScript',async()=>{
70+
letcwd=process.cwd();
71+
let{ packageManager, installScript}=awaitgetPackageManagerAndInstallScript(cwd);
72+
expect(packageManager).toBe('npm');
73+
expect(installScript).toBe('npm ci');
74+
75+
cwd=path.join(cwd,'tests');
76+
({ packageManager, installScript}=awaitgetPackageManagerAndInstallScript(cwd));
77+
expect(packageManager).toBe('npm');
78+
expect(installScript).toBe('npm install');
79+
});
80+
6881
test('fileExists',async()=>{
6982
expect(awaitfileExists('package.json')).toBe(true);
7083
expect(awaitfileExists('file-that-does-not-exist')).toBe(false);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp