Skip to content

Commit 9a7a43a

Browse files
armano2renovate[bot]renovate-botescapedcat
authored
test(config-lerna-scopes): reuse npm bootstrap to simplify tests (#2479)
* chore: update dependency @lerna/project to v4 (#2447) * chore: update dependency @lerna/project to v4 * feat!: update to lerna v4 BREAKING CHANGE: upgrade to lerna v4 Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: escapedcat <[email protected]> * test(config-lerna-scopes): reuse npm bootstrap to simplify tests * test(config-lerna-scopes): reuse npm bootstrap to simplify tests * test: fix issue after merge * test: one more fix after merge Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: escapedcat <[email protected]>
1 parent b0776ad commit 9a7a43a

File tree

12 files changed

+16
-53
lines changed

12 files changed

+16
-53
lines changed

Diff for: @commitlint/config-lerna-scopes/fixtures/basic/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "basic",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"lerna": "^4.0.0"
5+
"lerna": "^4.0.0",
6+
"@lerna/project": "^4.0.0"
67
}
78
}

Diff for: @commitlint/config-lerna-scopes/fixtures/empty/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "empty",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"lerna": "^4.0.0"
5+
"lerna": "^4.0.0",
6+
"@lerna/project": "^4.0.0"
67
}
78
}

Diff for: @commitlint/config-lerna-scopes/fixtures/lerna-two/lerna.json

-5
This file was deleted.

Diff for: @commitlint/config-lerna-scopes/fixtures/lerna-two/package.json

-7
This file was deleted.

Diff for: @commitlint/config-lerna-scopes/fixtures/lerna-two/packages/a2/package.json

-4
This file was deleted.

Diff for: @commitlint/config-lerna-scopes/fixtures/lerna-two/packages/b2/package.json

-4
This file was deleted.

Diff for: @commitlint/config-lerna-scopes/fixtures/modules/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "basic",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"lerna": "^4.0.0"
5+
"lerna": "^4.0.0",
6+
"@lerna/project": "^4.0.0"
67
}
78
}

Diff for: @commitlint/config-lerna-scopes/fixtures/scoped/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "scoped",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"lerna": "^4.0.0"
5+
"lerna": "^4.0.0",
6+
"@lerna/project": "^4.0.0"
67
}
78
}

Diff for: @commitlint/config-lerna-scopes/fixtures/yarn/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "yarn",
33
"version": "1.0.0",
44
"devDependencies": {
5-
"lerna": "^4.0.0"
5+
"lerna": "^4.0.0",
6+
"@lerna/project": "^4.0.0"
67
},
78
"workspaces": [
89
"@packages/*"

Diff for: @commitlint/config-lerna-scopes/index.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Path from 'path';
2-
import {lerna} from '@commitlint/test';
2+
import {npm} from '@commitlint/test';
33
import config from '.';
44

55
test('exports rules key', () => {
@@ -47,30 +47,30 @@ test('scope-enum has expected modifier', async () => {
4747

4848
test('returns empty value for empty lerna repository', async () => {
4949
const {'scope-enum': fn} = config.rules;
50-
const cwd = await lerna.bootstrap('empty', __dirname);
50+
const cwd = await npm.bootstrap('fixtures/empty', __dirname);
5151
const [, , value] = await fn({cwd});
5252
expect(value).toEqual([]);
5353
});
5454

5555
test('returns expected value for basic lerna repository', async () => {
5656
const {'scope-enum': fn} = config.rules;
57-
const cwd = await lerna.bootstrap('basic', __dirname);
57+
const cwd = await npm.bootstrap('fixtures/basic', __dirname);
5858

5959
const [, , value] = await fn({cwd});
6060
expect(value).toEqual(['a', 'b']);
6161
});
6262

6363
test('returns expected value for lerna repository containing modules', async () => {
6464
const {'scope-enum': fn} = config.rules;
65-
const cwd = await lerna.bootstrap('modules', __dirname);
65+
const cwd = await npm.bootstrap('fixtures/modules', __dirname);
6666

6767
const [, , value] = await fn({cwd});
6868
expect(value).toEqual(['a']);
6969
});
7070

7171
test('returns expected value for scoped lerna repository', async () => {
7272
const {'scope-enum': fn} = config.rules;
73-
const cwd = await lerna.bootstrap('scoped', __dirname);
73+
const cwd = await npm.bootstrap('fixtures/scoped', __dirname);
7474

7575
const [, , value] = await fn({cwd});
7676
expect(value).toEqual(['a', 'b']);

Diff for: @packages/test/src/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as fix from './fix';
22
import * as git from './git';
3-
import * as lerna from './lerna';
43
import * as npm from './npm';
54

6-
export {fix, git, lerna, npm};
5+
export {fix, git, npm};

Diff for: @packages/test/src/lerna.ts

-21
This file was deleted.

0 commit comments

Comments
 (0)