Skip to content

Commit 2742bac

Browse files
authored
Merge pull request #28 from greglittlefield-wf/js_tests
UIP-1903 Run unit tests in dart2js on CI
2 parents 7441ce6 + ab356ca commit 2742bac

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

smithy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ runner_image: drydock-prod.workiva.org/workiva/smithy-runner-dart:74173
66

77
script:
88
- pub get
9+
- ./tool/smithy_dart2js_tests.sh
910

1011
artifacts:
1112
build:

test/over_react/component/dom_components_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ library dom_components_test;
1717
// Tell dart2js that this library only needs to reflect the specified types.
1818
// This speeds up compilation and makes JS output much smaller.
1919
@MirrorsUsed(targets: const [
20-
'over_react.Dom'
20+
'over_react.dom_components.Dom'
2121
])
2222
import 'dart:mirrors';
2323

tool/dev.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ main(List<String> args) async {
3030
..pubServe = true
3131
..platforms = [
3232
'vm',
33-
'content-shell'
33+
'content-shell',
34+
// Can't run tests in dart2js on Travis since the suite takes too long to load and times out.
35+
// Run on Smithy instead.
36+
// See https://github.com/Workiva/over_react/issues/36
37+
// 'chrome',
3438
]
3539
// Prevent test load timeouts on Smithy.
3640
..concurrency = 1

tool/smithy_dart2js_tests.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
# Can't run tests in dart2js on Travis since the suite takes too long to load and times out.
4+
# Run on Smithy instead.
5+
# See https://github.com/Workiva/over_react/issues/36
6+
7+
set -e
8+
9+
# Trick the test package into using Chromium instead of Chrome
10+
TMP_BIN=$(mktemp -d)
11+
ln -s "$(which chromium-browser)" "$TMP_BIN/google-chrome"
12+
export PATH="$PATH:$TMP_BIN"
13+
14+
# Run the tests
15+
DART_FLAGS=--checked xvfb-run -s '-screen 0 1024x768x24' pub run dart_dev test -p chrome
16+
17+
# Be sneaky and clean up our tricks
18+
rm -rf "$TMP_BIN"

0 commit comments

Comments
 (0)