Skip to content

Commit

Permalink
[DNM] Fix CI (#765)
Browse files Browse the repository at this point in the history
* Fix eslint snap-linter

refer: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md

https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-large-snapshots.md

* Refactor ci-flaky latitude-longitude validation test

* Revert eslint ecmaVersion

* Remove surplus lint command
  • Loading branch information
peterMuriuki authored Aug 10, 2021
1 parent bc29cc0 commit 37b9c63
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
7 changes: 1 addition & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
name: Install dependencies
command: yarn install

# TODO - why does the test fail without this.
- run:
name: build packages
command: yarn lerna:prepublish
Expand All @@ -49,13 +48,9 @@ jobs:
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: Run ts linter
name: Run linter
command: yarn lint

- run:
name: Run snap linter
command: yarn lint-snap --debug

- run:
name: Run test with coverage
command: yarn test --verbose --collectCoverage=true --forceExit --detectOpenHandles
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"lerna:publish": "yarn install && yarn run lerna:prepublish && lerna publish from-package --ignore-scripts --ignore-prepublish",
"test": "TZ='UTC' jest",
"test:watch": "TZ='UTC' jest --watch",
"lint": "eslint {packages,app}/**/*.{js,ts,tsx} --max-warnings 0",
"lint-snap": "eslint {packages,app}/**/*.snap"
"lint": "eslint {packages,app}/**/*.{js,ts,tsx} --max-warnings 0"
},
"jest": {
"setupFiles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,12 @@ describe('LocationForm', () => {
wrapper.update();
});

expect(wrapper.find('FormItem#longitude').text()).toMatchInlineSnapshot(
`"LongitudeOnly decimal values allowed"`
);

expect(wrapper.find('FormItem#latitude').text()).toMatchInlineSnapshot(
`"LatitudeOnly decimal values allowed"`
);
expect(wrapper.find('FormItemInput#longitude').prop('errors')).toEqual([
'Only decimal values allowed',
]);
expect(wrapper.find('FormItemInput#latitude').prop('errors')).toEqual([
'Only decimal values allowed',
]);

wrapper.unmount();
});
Expand Down

0 comments on commit 37b9c63

Please sign in to comment.