-
Notifications
You must be signed in to change notification settings - Fork 28
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
fix: ignore test file in prepare #400
Conversation
@@ -0,0 +1 @@ | |||
export const foo = 'foo' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete foo.ts and bin/ as they're not relative for the tests
it("bar", () => { | ||
expect(true).toBe(true); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also run prettier format? I think the column can be erased, also will this file run in tests suite?
@@ -0,0 +1,5 @@ | |||
describe("foo", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, will this run? maybe change this to a spec file to cover .spec.
case
src/utils.ts
Outdated
|
||
export const isTestFile = (filename: string): boolean => | ||
// include .test. or .spec. in filename | ||
/\.(test|spec)\./.test(filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to test baseNameWithoutExtension
, cause it can be a.f.foo.spec.some.js
which looks like a random valid case.
/\.(test|spec)$/.test(baseNameWithoutExtension(filename))
All updated. Thanks for your review. |
package.json
Outdated
}, | ||
"testPathIgnorePatterns": [ | ||
"/node_modules/", | ||
"<rootDir>/test/integration/prepare-ts-with-test-file/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let’s ignore the tests from src/ folders under test/integration
test/integration/prepare-ts-with-test-file/src/index.react-server.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #398