Skip to content

Commit

Permalink
feat: execute all tests with lerna to test all packages
Browse files Browse the repository at this point in the history
Lerna can execute all package tests found in the repo
https://github.com/lerna/lerna/tree/main/commands/run#readme
  • Loading branch information
lili2311 committed Feb 22, 2021
1 parent 3775fcd commit e7d7a34
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
21 changes: 15 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ commands:
steps:
- run:
name: Build
command: npm run build
command: lerna run build --stream
- persist_to_workspace:
root: .
paths:
Expand Down Expand Up @@ -163,6 +163,9 @@ jobs:
name: Install npm@7
command: |
sudo npm install -g npm@7
- run:
name: Install Lerna
command: sudo npm install -g lerna
- show_node_version
- update_local_npmrc_linux
- install_deps
Expand Down Expand Up @@ -227,7 +230,10 @@ jobs:
command: echo "//registry.npmjs.org/:_authToken=$env:NPM_TOKEN" >> .npmrc
- run:
name: Install dependencies (Windows)
command: npm install --ignore-scripts # ignore-scripts required because of postinstall script in snyk-resolve-deps package
command: npm install
- run:
name: Install Lerna
command: npm install -g lerna
- build_ts
- run:
name: npm version
Expand All @@ -241,25 +247,25 @@ jobs:
steps:
- run:
name: Run "Root" tap tests
command: npm run test:test
command: lerna run test:test --stream
- when:
condition: << parameters.jest_tests >>
steps:
- run:
name: Run Jest tests
command: npm run test:jest
command: lerna run test:jest --stream
- when:
condition: << parameters.acceptance_tests >>
steps:
- run:
name: Run Acceptance tests
command: npm run test:acceptance-windows
command: lerna run test:acceptance-windows --stream
- when:
condition: << parameters.system_tests >>
steps:
- run:
name: Run System tests
command: npm run test:system
command: lerna run test:system --stream

test-linux:
<<: *defaults
Expand All @@ -279,6 +285,9 @@ jobs:
condition: << parameters.use_npm7 >>
steps:
- run: sudo npm install -g npm@7
- run:
name: Install Lerna
command: sudo npm install -g lerna
- show_node_version
- update_local_npmrc_linux
- install_deps
Expand Down
8 changes: 4 additions & 4 deletions test/analytics.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Analytics basic testing', () => {
'integrationEnvironmentVersion',
].sort(),
);
});
}, 10000);

it('Has all analytics arguments when org is specified', async () => {
analytics.add('foo', 'bar');
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('Analytics basic testing', () => {
'integrationEnvironmentVersion',
].sort(),
);
});
}, 10000);

it('Has all analytics arguments when args are given', async () => {
analytics.add('foo', 'bar');
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('Analytics basic testing', () => {
'integrationEnvironmentVersion',
].sort(),
);
});
}, 10000);

it('Has all analytics arguments when org is specified and args are given', async () => {
analytics.add('foo', 'bar');
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('Analytics basic testing', () => {
'integrationEnvironmentVersion',
].sort(),
);
});
}, 10000);

it('Has analytics given values', async () => {
analytics.add('foo', 'bar');
Expand Down

0 comments on commit e7d7a34

Please sign in to comment.