git.iko.soy/typeable/elm-ui
on master help sign in
move rendering tests yet again because elm-test is rightfully wary of elm dirs within elm dirs.
commit169da2aa7a60bd7de989bb37a75bb98628b4524a authorMatthew Griffith <mdg.griffith@gmail.com> dateWed 11 Mar 2020, 23:23 (7 years ago) parentb5e62b8
29 files changed+27−20
README.md+3−4 notes/CHANGES-FROM-STYLE-ELEMENTS.md−3 notes/RUNNING_TESTS.md+13−3 package.json+2−2 tests/rendering/automation/publish-file.sh → tests-rendering/automation/publish-file.sh tests/rendering/automation/run.js → tests-rendering/automation/run.js+3−3 tests/rendering/automation/templates/gather-styles.html → tests-rendering/automation/templates/gather-styles.html tests/rendering/elm.json → tests-rendering/elm.json+1−1 tests/rendering/src/Generator.elm → tests-rendering/src/Generator.elm tests/rendering/src/Testable.elm → tests-rendering/src/Testable.elm tests/rendering/src/Testable/Element.elm → tests-rendering/src/Testable/Element.elm tests/rendering/src/Testable/Element/Background.elm → tests-rendering/src/Testable/Element/Background.elm tests/rendering/src/Testable/Element/Font.elm → tests-rendering/src/Testable/Element/Font.elm tests/rendering/src/Testable/FuzzMain.elm.old → tests-rendering/src/Testable/FuzzMain.elm.old tests/rendering/src/Testable/Runner.elm → tests-rendering/src/Testable/Runner.elm tests/rendering/src/Tests/Basic.elm → tests-rendering/src/Tests/Basic.elm tests/rendering/src/Tests/ColumnAlignment.elm → tests-rendering/src/Tests/ColumnAlignment.elm tests/rendering/src/Tests/ColumnSpacing.elm → tests-rendering/src/Tests/ColumnSpacing.elm tests/rendering/src/Tests/ElementAlignment.elm → tests-rendering/src/Tests/ElementAlignment.elm tests/rendering/src/Tests/Nearby.elm → tests-rendering/src/Tests/Nearby.elm tests/rendering/src/Tests/Palette.elm → tests-rendering/src/Tests/Palette.elm tests/rendering/src/Tests/RowAlignment.elm → tests-rendering/src/Tests/RowAlignment.elm tests/rendering/src/Tests/RowSpacing.elm → tests-rendering/src/Tests/RowSpacing.elm tests/rendering/src/Tests/Run.elm → tests-rendering/src/Tests/Run.elm tests/rendering/src/Tests/Table.elm.todo → tests-rendering/src/Tests/Table.elm.todo tests/rendering/src/Tests/Transparency.elm → tests-rendering/src/Tests/Transparency.elm tests/rendering/src/Tests/WidthHeight.elm → tests-rendering/src/Tests/WidthHeight.elm tests/ClassNames.elm+5−3 tests/Flags.elm−1
README.md+3−4
@@ -55,9 +55,6 @@ myElement =
5555 (text "stylish!")
5656```
5757
58−
59−
60−
6158## History
6259
6360The work is based off of a rewrite of the [Style Elements](https://github.com/mdgriffith/style-elements) library. A lot of that work was originally released under the [Stylish Elephants](https://github.com/mdgriffith/stylish-elephants) project.
@@ -68,4 +65,6 @@ The community around `elm-ui` is maintaining a collection of examples called the
6865
6966## Contributing
7067
71−Want to help out fixing bugs or reporting issues? Please add issues you find, and if you want to verify code you want to contribute, please read how to run the tests [here](https://github.com/mdgriffith/elm-ui/blob/master/notes/RUNNING_TESTS.md).
68+Want to help out fixing bugs or reporting issues?
69+
70+Please add issues you find, and if you want to verify code you want to contribute, please read how to run the tests [here](https://github.com/mdgriffith/elm-ui/blob/master/notes/RUNNING_TESTS.md).
notes/CHANGES-FROM-STYLE-ELEMENTS.md−3
@@ -1,10 +1,7 @@
11# Compared to Style Elements
22
3−
43This was a MAJOR rewrite of Style Elements.
54
6−
7−
85* **Major Performance improvement** - Style Elements v5 is much faster than v4 due to a better rendering strategy and generating very minimal html. The rewritten architecture also allows me to explore a few other optimizations, so things may get even faster than they are now.
96
107* **Lazy is here!** - It works with no weird caveats.
notes/RUNNING_TESTS.md+13−3
@@ -18,15 +18,25 @@ yarn run test # or npm run test
1818
1919In order to do this, we need a different testing environment.
2020
21−So, the tests in `elm-ui/tests/Tests` will render output, then harvest bounding boxes form the browser, and run the test on the resulting data.
21+So, the tests in `elm-ui/tests-rendering/src/Tests` will render output, then harvest bounding boxes form the browser, and run the test on the resulting data.
2222
2323Run this locally via:
2424
2525```bash
26−yarn install
27−yarn test-render
26+yarn install # or npm install
27+yarn test-render # or npm run test-render
28+```
29+
30+**Note** if you run this, it runs by default in headless chrome, so you won't see a browser actually open. Ideally you'll just see something like this:
2831
2932```
33+Compiling tests
34+Done compiling
35+Running locally on Chrome...
36+Local Chrome -> All 18029 tests passed
37+```
38+
39+That's right. We have 18,029 tests. Whew.
3040
3141# Running on Sauce Labs
3242
package.json+2−2
@@ -5,8 +5,8 @@
55 "main": "index.js",
66 "scripts": {
77 "test": "elm-test",
8− "test-render": "node tests/rendering/automation/run.js --chrome",
9− "test-render-sauce": "source sauce.env; node tests/rendering/automation/run.js --sauce",
8+ "test-render": "node tests-rendering/automation/run.js --chrome",
9+ "test-render-sauce": "source sauce.env; node tests-rendering/automation/run.js --sauce",
1010 "bench": "node benchmarks/runtime/index.js"
1111 },
1212 "repository": {
tests/rendering/automation/publish-file.sh → tests-rendering/automation/publish-file.shrenamed

The content is the same.

tests/rendering/automation/run.js → tests-rendering/automation/run.jsrenamed+3−3
@@ -173,10 +173,10 @@ async function run_test(driver, url) {
173173 }
174174 console.log("Compiling tests")
175175 await compile_and_embed({
176− template: "./tests/rendering/automation/templates/gather-styles.html",
176+ template: "./tests-rendering/automation/templates/gather-styles.html",
177177 target: "./tmp/test.html",
178178 elm: ["src/Tests/Run.elm"],
179− elmOptions: { cwd: "./tests/rendering" }
179+ elmOptions: { cwd: "./tests-rendering" }
180180 })
181181 console.log("Done compiling")
182182
@@ -191,7 +191,7 @@ async function run_test(driver, url) {
191191 var results = []
192192
193193 // Publish to netlify
194− childProcess.execSync("sh tests/rendering/automation/publish-file.sh", {
194+ childProcess.execSync("sh tests-rendering/automation/publish-file.sh", {
195195 env: {
196196 FILE: "test.html",
197197 BUILD: program.build,
tests/rendering/automation/templates/gather-styles.html → tests-rendering/automation/templates/gather-styles.htmlrenamed

The content is the same.

tests/rendering/elm.json → tests-rendering/elm.jsonrenamed+1−1
@@ -2,7 +2,7 @@
22 "type": "application",
33 "source-directories": [
44 "src",
5− "../../src"
5+ "../src"
66 ],
77 "elm-version": "0.19.1",
88 "dependencies": {
tests/rendering/src/Generator.elm → tests-rendering/src/Generator.elmrenamed

The content is the same.

tests/rendering/src/Testable.elm → tests-rendering/src/Testable.elmrenamed

The content is the same.

tests/rendering/src/Testable/Element.elm → tests-rendering/src/Testable/Element.elmrenamed

The content is the same.

tests/rendering/src/Testable/Element/Background.elm → tests-rendering/src/Testable/Element/Background.elmrenamed

The content is the same.

tests/rendering/src/Testable/Element/Font.elm → tests-rendering/src/Testable/Element/Font.elmrenamed

The content is the same.

tests/rendering/src/Testable/FuzzMain.elm.old → tests-rendering/src/Testable/FuzzMain.elm.oldrenamed

The content is the same.

tests/rendering/src/Testable/Runner.elm → tests-rendering/src/Testable/Runner.elmrenamed

The content is the same.

tests/rendering/src/Tests/Basic.elm → tests-rendering/src/Tests/Basic.elmrenamed

The content is the same.

tests/rendering/src/Tests/ColumnAlignment.elm → tests-rendering/src/Tests/ColumnAlignment.elmrenamed

The content is the same.

tests/rendering/src/Tests/ColumnSpacing.elm → tests-rendering/src/Tests/ColumnSpacing.elmrenamed

The content is the same.

tests/rendering/src/Tests/ElementAlignment.elm → tests-rendering/src/Tests/ElementAlignment.elmrenamed

The content is the same.

tests/rendering/src/Tests/Nearby.elm → tests-rendering/src/Tests/Nearby.elmrenamed

The content is the same.

tests/rendering/src/Tests/Palette.elm → tests-rendering/src/Tests/Palette.elmrenamed

The content is the same.

tests/rendering/src/Tests/RowAlignment.elm → tests-rendering/src/Tests/RowAlignment.elmrenamed

The content is the same.

tests/rendering/src/Tests/RowSpacing.elm → tests-rendering/src/Tests/RowSpacing.elmrenamed

The content is the same.

tests/rendering/src/Tests/Run.elm → tests-rendering/src/Tests/Run.elmrenamed

The content is the same.

tests/rendering/src/Tests/Table.elm.todo → tests-rendering/src/Tests/Table.elm.todorenamed

The content is the same.

tests/rendering/src/Tests/Transparency.elm → tests-rendering/src/Tests/Transparency.elmrenamed

The content is the same.

tests/rendering/src/Tests/WidthHeight.elm → tests-rendering/src/Tests/WidthHeight.elmrenamed

The content is the same.

tests/ClassNames.elm+5−3
@@ -3,12 +3,12 @@ module ClassNames exposing (suite)
33{-| -}
44
55import Expect
6−import Html
7−import Internal.Flag as Flag
6+import Html exposing (Html)
87import Internal.Style
9−import Test
8+import Test exposing (Test)
109
1110
11+suite : Test
1212suite =
1313 Test.describe "Classname Collisions"
1414 [ Test.test "No duplicates" <|
@@ -17,6 +17,7 @@ suite =
1717 ]
1818
1919
20+main : Html msg
2021main =
2122 Html.div []
2223 [ Html.text "The following names collide"
@@ -25,6 +26,7 @@ main =
2526 ]
2627
2728
29+viewPair : ( String, String ) -> Html msg
2830viewPair ( name, description ) =
2931 Html.div []
3032 [ Html.text name
tests/Flags.elm−1
@@ -3,7 +3,6 @@ module Flags exposing (suite)
33{-| -}
44
55import Expect
6−import Html
76import Internal.Flag as Flag
87import Test
98