Skip to content
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

chore: normalize test config #643

Merged
merged 4 commits into from Aug 21, 2023
Merged

Conversation

boneskull
Copy link
Contributor

This change does the following:

  1. Upgrade ava.
  2. Rename all test file extensions to .spec.js.
  3. Relocate all Ava config into the package.json of each workspace.
  4. Change some commented-out tests to skipped tests.
  5. BONUS: Config to run all tests via e.g., npm exec ava from the workspace root

@boneskull boneskull requested a review from a team August 8, 2023 23:15
@boneskull boneskull self-assigned this Aug 8, 2023
@boneskull boneskull added the chore overhead, tests, dev env, etc. label Aug 8, 2023
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch from b72d521 to da483d1 Compare August 9, 2023 00:00
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch 2 times, most recently from 9009897 to 70a2875 Compare August 10, 2023 22:03
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch from fe9e6eb to 7e5eb91 Compare August 11, 2023 04:55
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch from 7e5eb91 to ceb7409 Compare August 16, 2023 22:19
@boneskull boneskull changed the base branch from boneskull/npm to main August 16, 2023 22:33
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch from ceb7409 to 0cea079 Compare August 16, 2023 22:33
@@ -11,7 +11,7 @@
},
"scripts": {
"test": "npm run test:run",
"test:run": "ava --timeout=30s test/index.js",
"test:run": "ava",
Copy link
Member

@naugtur naugtur Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(can be ignored) IMHO the arguments are more convenient as one can copy the call and modify/extend without thinking of the configuration elsewhere, but I'm ok with this change as it provides benefits elsewhere. Consistency is more valuable than copy-pasting.

t.notThrows(() => {
espree.parse(code, {
ecmaVersion: ECMA_VERSION,
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(should) This test used to be more informative.
It's likely that if this test fails, it does so unexpectedly and a more descriptive message (ie containing the runtime.js` filename) is going to be helpful for the person encountering it.

Copy link
Contributor Author

@boneskull boneskull Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I'll restore the custom failure output, but keep it in an ava test.

@@ -1,7 +1,15 @@
const test = require('ava')
const { utils: { mergePolicy, mergeConfigEntire, objToMap, mapToObj } } = require('../src/index')

testMergePartial('upgrades reads to writes', {
const testMergePartial = test.macro(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! when was it introduced? I haven't seen test.macro used before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea, I'm new to ava, but discovered this while I was poking around.

@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch 2 times, most recently from 34b2c42 to 61db1f9 Compare August 17, 2023 23:58
This change does the following:

1. Upgrade `ava`.
2. Rename all test file extensions to `.spec.js`.
3. Relocate all Ava config into the `package.json` of each workspace.
4. Change some commented-out tests to skipped tests.
5. BONUS: Config to run all tests via e.g., `npm exec ava` from the workspace root
@boneskull boneskull force-pushed the boneskull/normalize-test-filenames branch from 30d88e0 to 96c905b Compare August 21, 2023 21:45
@boneskull boneskull merged commit b941c04 into main Aug 21, 2023
9 checks passed
@boneskull boneskull deleted the boneskull/normalize-test-filenames branch August 22, 2023 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore overhead, tests, dev env, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants