-
Notifications
You must be signed in to change notification settings - Fork 453
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
Create integration tests with Jest caching enabled #32
Comments
It is strange that build is failing on semaphore due to compilation error. @kulshekhar, could you check it? Because I've removed But, there is some real problems in this commit. it('should show the correct error locations in the typescript files without changes', async () => {
let stderr = await result.getStderrAsync();
expect(stderr).toContain('Hello.ts:13:11');
expect(stderr).toContain('Hello.test.ts:9:19');
});
it('should show the correct error locations in the typescript files with changes in source file', async () => {
fs.writeFileSync(path.resolve(__dirname, '../watch-test/Hello.ts'), helloFileUpdate);
let stderr = await result.getStderrAsync();
expect(stderr).toContain('Hello.ts:11:11');
expect(stderr).toContain('Hello.test.ts:9:19');
});
it('should show the correct error locations in the typescript files with changes in source file and test file', async () => {
fs.writeFileSync(path.resolve(__dirname, '../watch-test/__tests__/Hello.test.ts'), testFileUpdate);
let stderr = await result.getStderrAsync();
expect(stderr).toContain('Hello.ts:11:11');
expect(stderr).toContain('Hello.test.ts:11:19');
}); In this code only first |
@Igmat It seems to be building fine now although there is a failing test.
This output possibly has the reason why you're getting that error |
This is weird. I just cloned the repo to a fresh directory, switched to the new branch, ran |
And when I log in to the CI machine and do the same thing, it works there as well |
@kulshekhar yeap, I have same problems. On fresh run almost always tests are succeeded, but rerunning them will probably lead to timeout error and I can't find a reason why this is happening. |
@Igmat This might be an issue related to unresolved promises as stated here https://facebook.github.io/jest/docs/troubleshooting.html#unresolved-promises Replacing async/await with a promise based implementation seemed to work. |
@Igmat turns out this issue was caused due to the nodejs version (I checked against 6.3 and 6.6). It's crazy. I've switched to Travis for CI and that seems to have solved this problem. |
It's really strange bug. While running test first time it works, but after rerun I have this type of error:
And it doesn't matter what type of async is used (ES6 with |
Maybe just switch to using promises for now? It worked when I tested it. |
I can't see your commit for promises implementation, but as I remember you've forgotten to return promise in |
It passes with at least V6 & V7 |
Why is the target set to |
@kulshekhar, I've tested it with |
@kulshekhar, I've used your branch and run tests locally 2 times. First it works perfect, second fails with same error as in my branch. Seems that problem is with spawning and killing child-process, or may be with raising events from it. It could be caused by |
Ok, I've found a way to test it with default |
@Igmat I think you misunderstood what The reasoning for not accepting the idea is that this is a drop-in replacement for |
@satazor, Ok, I understand the point with drop-in replacement for |
@Igmat I've missed that. I understand what you mean. Still https://github.com/kentcdodds/cross-spawn-with-kill is also incompatible with what nodejs offers: it doesn't allow a custom signal :( |
@satazor, and it probably has some issues with running on *nix, cause build weren't failed when I've used default |
Solved by 42a75c5, so we only have to improve test cases. |
This issue is for tracking of implementation of tests for issue #30.
I'm not sure that I'll be able to complete this task soon, but definitely will try to find a way.
Some thoughts:
watch-test
;runJestInWatch.ts
based onrunJest.ts
with--watch
or--watchAll
enabled;3a. Run tests in
watch-test
and collect results*;3b. Change test file in
watch-test
and collect results*;3c. Change source file in
watch-test
and collect results*;3d. Change config file in
watch-test
and collect results*;3e. Terminate process;
watch.spec.ts
that runs this helpers and checks results for correctness.The text was updated successfully, but these errors were encountered: