Open aksonov opened 4 years ago
The problem is that the original test was giving a false positive.
it('first name ends with space', async () => {
try {
await validateProfile({firstName: 'Eric '})
} catch (err) {
expect(err).toStrictEqual({
firstName: ['First name can only contain alphabet characters'],
})
}
})
Inside the try
block I should have expect
ed it to throw an error like this...
expect(await validateProfile({firstName: 'Eric '})).toThrow()
So while the correct error may have been thrown at some point in the past, it was lost in future revisions but the test kept on saying everything was ok.
I found that rn-chat tests are not run and fail now
I dug into this.
In PR 4187 ('upgrade to RN0.61') there was this comment:
https://github.com/hippware/rn-chat/pull/4187#issuecomment-535697542
I'm going to deactivate jest snapshot tests for now, create a ticket, and reactivate later when they're fixed.
followed by commit f4c7c43c which removed ... npm run jestCI
from the CLI yarn test
PR 4187 was merged and into 4.27.0.
I'm guessing that when @southerneer disabled the jest snapshot tests (*.test.tsx) by removing ... npm run jestCI
, he didn't realise it also disabled HomeStore.test.ts
and formValidation.test.ts
?
So ... maybe consider doing the following?:
HomeStore.test.ts
and formValidation.test.ts
again. An easy way would be to copy them into the wocky tests.yarn jestCI
, yarn jestWockyCI
etc. is a bit out of date.
@southerneer Maybe you have idea why original formValidation test 'first name ends with space'' works well but the same firstName doesn't throw error from my refactored copy?
P. S. Btw, I found that rn-chat tests are not run and fail now