-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Try add anothor tests #1
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ yarn jest --watchAll
PASS modules/bbb/__tests__/index.js
PASS src/sum.test.js
FAIL modules/aaa/__tests__/index.js
● Test suite failed to run
Cannot find module '../config/index.js' from 'index.js'
1 | 'use strict';
2 |
> 3 | import config from '../config/index.js';
| ^
4 |
5 | function doit(directory) {
6 | return 'aaa:' + config.type;
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
at Object.<anonymous> (modules/aaa/src/index.js:3:1)
PASS __tests__/FileSummarizer-test.js
Test Suites: 1 failed, 3 passed, 4 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 2.466s
Ran all test suites.
Watch Usage
› Press f to run only failed tests.
› Press o to only run tests related to changed files.
› Press p to filter by a filename regex pattern.
› Press t to filter by a test name regex pattern.
› Press q to quit watch mode.
› Press Enter to trigger a test run. |
🤔 FAIL modules/aaa/__tests__/a.test.js
● aaa › aaa
expect(received).toBe(expected) // Object.is equality
Expected: "a < type is: mocked A"
Received: "a < type is: A"
7 | describe('aaa', () => {
8 | test('aaa', () => {
> 9 | expect(doit()).toBe('a < type is: mocked A')
| ^
10 | });
11 | });
12 |
at Object.toBe (modules/aaa/__tests__/a.test.js:9:20)
PASS __tests__/FileSummarizer-test.js
PASS src/sum.test.js
FAIL modules/bbb/__tests__/b.test.js
● bbb › bbb
expect(received).toBe(expected) // Object.is equality
Expected: "b < name is: mocked B"
Received: "b < name is: B"
7 | describe('bbb', () => {
8 | test('bbb', () => {
> 9 | expect(doit()).toBe('b < name is: mocked B')
| ^
10 | });
11 | });
12 |
at Object.toBe (modules/bbb/__tests__/b.test.js:9:20)
Test Suites: 2 failed, 2 passed, 4 total
Tests: 2 failed, 2 passed, 4 total
Snapshots: 0 total
Time: 2.585s
Ran all test suites.
Watch Usage: Press w to show more. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Import not transpile with babel-jest
https://github.com/kentcdodds/how-jest-mocking-works
https://deltice.github.io/jest/docs/en/webpack.html#content