-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add React version test setup validation test
- Loading branch information
1 parent
39a11c6
commit 5af2504
Showing
1 changed file
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@JS() | ||
library react_version_test; | ||
|
||
import 'package:js/js.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
// This test helps us verify our test setup, ensuring | ||
// we're running on the React version we expect to be. | ||
test('Setup check: window.React is React 18', () { | ||
expect(reactVersion, startsWith('18.')); | ||
}); | ||
|
||
// TODO: Once we do a dual-CI setup, we can conditionall verify this using tags | ||
// test('Setup check: window.React is React 17', () { | ||
// expect(reactVersion, startsWith('17.')); | ||
// }, tags: 'react-17'); | ||
// test('Setup check: window.React is React 18', () { | ||
// expect(reactVersion, startsWith('18.')); | ||
// }, tags: 'react-18'); | ||
// Then, when running tests: | ||
// - on React 17: `dart run build_runner test -- ... --exclude-tags=react-18` | ||
// - on React 18: `dart run build_runner test -- ... --exclude-tags=react-17` | ||
} | ||
|
||
@JS('React.version') | ||
external String get reactVersion; |