Skip to content

Commit

Permalink
chore: fixes tests on Windows using Unix-style path (#1420)
Browse files Browse the repository at this point in the history
* chore: allows longer commit body

Changes the commitlint configuration to allow commit bodies of any length.

* chore: fixes tests on Windows using Unix-style path

Fixes a test passing a Unix-style path to child_process.exec which failed on Windows by wrapping it in `path.resolve`.

Fixes a test relying on some internal logic which only took Unix-style paths into account.

Co-authored-by: Artem Zakharchenko <kettanaito@gmail.com>
  • Loading branch information
kleinfreund and kettanaito committed Oct 1, 2022
1 parent 933a9d6 commit dae755d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions commitlint.config.js
@@ -1,6 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [0, 'always', Infinity],
'footer-max-line-length': [1, 'always'],
},
}
2 changes: 1 addition & 1 deletion src/utils/internal/getCallFrame.ts
@@ -1,5 +1,5 @@
// Ignore the source files traces for local testing.
const SOURCE_FRAME = /\/msw\/src\/(.+)/
const SOURCE_FRAME = /[\/\\]msw[\/\\]src[\/\\](.+)/

const BUILD_FRAME =
/(node_modules)?[\/\\]lib[\/\\](umd|esm|iief|cjs)[\/\\]|^[^\/\\]*$/
Expand Down
2 changes: 1 addition & 1 deletion test/msw-api/cli/init.test.ts
Expand Up @@ -161,7 +161,7 @@ test('does not produce eslint errors or warnings', async () => {
expect(init.stderr).toEqual('')

const eslint = await promisifyChildProcess(
exec(`node_modules/.bin/eslint ${fsMock.resolve()}`),
exec(path.resolve(`node_modules/.bin/eslint ${fsMock.resolve()}`)),
)
expect(eslint.stdout).toEqual('')
expect(eslint.stderr).toEqual('')
Expand Down

0 comments on commit dae755d

Please sign in to comment.