Use jest for unittesting - standardize unit testing epic#904
Use jest for unittesting - standardize unit testing epic#904
Conversation
So far, we've set up the tools and have one failing test inside storyshots.
The mocks here a bit complicated, so I'm leaving them for later
# Conflicts: # .eslintrc # .gitignore # package.json # packages/addon-knobs/package.json # packages/addon-knobs/yarn.lock # packages/react-storybook/package.json # packages/storybook-ui/package.json # packages/storybook-ui/src/modules/api/actions/__tests__/api.js # packages/storybook-ui/src/modules/shortcuts/actions/__tests__/shortcuts.js # packages/storybook-ui/src/modules/ui/actions/__tests__/ui.js # packages/storybook-ui/src/modules/ui/configs/__tests__/handle_keyevents.js # packages/storybook-ui/src/modules/ui/configs/__tests__/handle_routing.js # packages/storybook-ui/src/modules/ui/configs/__tests__/init_panels.js # packages/storyshots/package.json # packages/storyshots/stories/__test__/__snapshots__/storyshots.test.js.snap
6f6a652 to
13b0938
Compare
shilman
left a comment
There was a problem hiding this comment.
Approved but with some caviats. See comments.
| after_success: ./scripts/travis/after_success.sh | ||
| script: npm run lint && npm run test | ||
| script: | ||
| - "npm run lint" |
There was a problem hiding this comment.
@ndelangen remove " marks? see https://docs.travis-ci.com/user/customizing-the-build
| import { expect } from 'chai'; | ||
| import ClientAPI from '../client_api'; | ||
|
|
||
| const { describe, it } = global; |
| @@ -1,6 +1,4 @@ | |||
| import actions from '../shortcuts'; | |||
| import { expect } from 'chai'; | |||
| const { describe, it } = global; | |||
| describe('manager.ui.containers.layout', () => { | ||
| describe('mapper', () => { | ||
| it('should give correct data', () => { | ||
| test('should give correct data', () => { |
There was a problem hiding this comment.
test is the default and mentioned all over the documentation.
| @@ -1,2 +0,0 @@ | |||
| import initStoryshots from '../../src'; | |||
There was a problem hiding this comment.
are we not testing storyshots? is this temporary?
There was a problem hiding this comment.
The way they were tested was just a smoke test, which breaks now because the main index isn't executed within the context of that package's package.json
There was a problem hiding this comment.
yes temporary indeed, the implementation was a bad smoke-test. Someone needs to do a thorough analysis on how to test it.
shilman
left a comment
There was a problem hiding this comment.
If I change .eslintrc.js to extend airbnb-base, it shows me lots of linting errors.
extends: [
'airbnb-base',
],
I believe the current configuration is incorrectly swallowing a lot of errors.
|
@ndelangen I see you're trying out |
|
Ok, @shilman I agree, linting can be made much more strict then it is now. I will setup a new branch and PR for that. I think we can merge this and then start working on improving linting? |
|
OK @ndelangen I agree with that solution, because we are doing heavy lifting on the monorepo transition and it's better to have these big changes merged. But FYI, I added a line in some source file that said only |
|
View your CI Pipeline Execution ↗ for commit bfd9d26.
☁️ Nx Cloud last updated this comment at |
Issue:
What I did