-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(@astrojs/integrations/react) Migrate tests to
node:test
for `…
…@astrojs/react` (#9899) * Migrate Telemetry tests to node:test * Remove fallback to chai * Remove chai and mocha dependencies * Fix trailing comma * Fix pnpm-lock.yaml desync * Add back old tests with progression * Convert tests to node:test * Remove unused dependencies * Remove artifact changes * Revert more artifacts * Fix more
- Loading branch information
Showing
4 changed files
with
39 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/integrations/react/test/parsed-react-children.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import { expect } from 'chai'; | ||
import assert from 'node:assert/strict'; | ||
import { describe, it } from 'node:test'; | ||
import convert from '../vnode-children.js'; | ||
|
||
describe('experimental react children', () => { | ||
it('has undefined as children for direct children', () => { | ||
const [imgVNode] = convert('<img src="abc"></img>'); | ||
expect(imgVNode.props).to.deep.include({ children: undefined }); | ||
assert.deepStrictEqual(imgVNode.props.children, undefined); | ||
}); | ||
|
||
it('has undefined as children for nested children', () => { | ||
const [divVNode] = convert('<div><img src="xyz"></img></div>'); | ||
const [imgVNode] = divVNode.props.children; | ||
expect(imgVNode.props).to.deep.include({ children: undefined }); | ||
assert.deepStrictEqual(imgVNode.props.children, undefined); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.