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

test: Checking Bun compatibility #1264

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"installCommand": "install:csb",
"sandboxes": ["github/kentcdodds/react-testing-library-examples"],
"node": "14"
"node": "18"
}
39 changes: 39 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
with:
node-version: ${{ matrix.node }}

# Ideally done by actions/setup-node: https://github.com/actions/setup-node/issues/213
- name: Setup package manager
run: npm install -g [email protected]

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
Expand All @@ -61,6 +65,37 @@ jobs:
fail_ci_if_error: true
flags: node-${{ matrix.node }}

bun:
permissions:
contents: read # to fetch code (actions/checkout)
# ignore all-contributors PRs
if: ${{ !contains(github.head_ref, 'all-contributors') }}
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
# required by codecov/codecov-action
fetch-depth: 0

- name: ⎔ Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.2

# TODO: Can be removed if https://github.com/kentcdodds/kcd-scripts/pull/146 is released
- name: Verify format (`npm run format` committed?)
run: bun run format --check --no-write

- name: ▶️ Run validate script
run: bun run validate

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
flags: bun

release:
permissions:
contents: write # to create release tags (cycjimmy/semantic-release-action)
Expand All @@ -80,6 +115,10 @@ jobs:
with:
node-version: 14

# Ideally done by actions/setup-node: https://github.com/actions/setup-node/issues/213
- name: Setup package manager
run: npm install -g [email protected]

- name: 📥 Download deps
uses: bahmutov/npm-install@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ dist

# these cause more harm than good
# when working with contributors
bun.lockb
package-lock.json
yarn.lock
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@
"ios_saf 12.2-12.5",
"kaios 2.5",
"op_mini all",
"op_mob 64",
"op_mob 73",
"opera 88",
"safari 15.5",
"samsung 17.0",
"samsung 16.0",
"node 14.0"
],
"scripts": {
"build": "kcd-scripts build --no-ts-defs --ignore \"**/__tests__/**,**/__node_tests__/**,**/__mocks__/**\" && kcd-scripts build --no-ts-defs --bundle --no-clean",
"format": "kcd-scripts format",
"build": "bunx kcd-scripts build --no-ts-defs --ignore \"**/__tests__/**,**/__node_tests__/**,**/__mocks__/**\" && kcd-scripts build --no-ts-defs --bundle --no-clean",
"format": "bunx kcd-scripts format",
"install:csb": "npm install",
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
"lint": "bunx kcd-scripts lint",
"setup": "bun install && bun run validate -s",
"test": "bunx kcd-scripts test",
"test:debug": "node --inspect-brk ./node_modules/.bin/jest --watch --runInBand",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate",
"typecheck": "kcd-scripts typecheck --build types"
"test:update": "bun run test -- --updateSnapshot --coverage",
"validate": "bunx kcd-scripts validate",
"typecheck": "bunx kcd-scripts typecheck --build types"
},
"files": [
"dist",
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/ariaAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ test('`selected: true` matches `aria-selected="true"` on supported roles', () =>

expect(getAllByRole('option', {selected: true}).map(({id}) => id)).toEqual([
'selected-native-option',
'unselected-native-option',
'selected-listbox-option',
])

Expand Down