mirror of
https://github.com/mdgriffith/elm-ui.git
synced 2024-11-25 08:22:55 +03:00
move rendering tests yet again because elm-test is rightfully wary of elm dirs within elm dirs.
This commit is contained in:
parent
b5e62b8fff
commit
169da2aa7a
@ -55,9 +55,6 @@ myElement =
|
||||
(text "stylish!")
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## History
|
||||
|
||||
The 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
|
||||
|
||||
## Contributing
|
||||
|
||||
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).
|
||||
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).
|
||||
|
@ -1,10 +1,7 @@
|
||||
# Compared to Style Elements
|
||||
|
||||
|
||||
This was a MAJOR rewrite of Style Elements.
|
||||
|
||||
|
||||
|
||||
* **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.
|
||||
|
||||
* **Lazy is here!** - It works with no weird caveats.
|
||||
|
@ -18,15 +18,25 @@ yarn run test # or npm run test
|
||||
|
||||
In order to do this, we need a different testing environment.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
Run this locally via:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
yarn test-render
|
||||
yarn install # or npm install
|
||||
yarn test-render # or npm run test-render
|
||||
```
|
||||
|
||||
**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:
|
||||
|
||||
```
|
||||
Compiling tests
|
||||
Done compiling
|
||||
Running locally on Chrome...
|
||||
Local Chrome -> All 18029 tests passed
|
||||
```
|
||||
|
||||
That's right. We have 18,029 tests. Whew.
|
||||
|
||||
# Running on Sauce Labs
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "elm-test",
|
||||
"test-render": "node tests/rendering/automation/run.js --chrome",
|
||||
"test-render-sauce": "source sauce.env; node tests/rendering/automation/run.js --sauce",
|
||||
"test-render": "node tests-rendering/automation/run.js --chrome",
|
||||
"test-render-sauce": "source sauce.env; node tests-rendering/automation/run.js --sauce",
|
||||
"bench": "node benchmarks/runtime/index.js"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -173,10 +173,10 @@ async function run_test(driver, url) {
|
||||
}
|
||||
console.log("Compiling tests")
|
||||
await compile_and_embed({
|
||||
template: "./tests/rendering/automation/templates/gather-styles.html",
|
||||
template: "./tests-rendering/automation/templates/gather-styles.html",
|
||||
target: "./tmp/test.html",
|
||||
elm: ["src/Tests/Run.elm"],
|
||||
elmOptions: { cwd: "./tests/rendering" }
|
||||
elmOptions: { cwd: "./tests-rendering" }
|
||||
})
|
||||
console.log("Done compiling")
|
||||
|
||||
@ -191,7 +191,7 @@ async function run_test(driver, url) {
|
||||
var results = []
|
||||
|
||||
// Publish to netlify
|
||||
childProcess.execSync("sh tests/rendering/automation/publish-file.sh", {
|
||||
childProcess.execSync("sh tests-rendering/automation/publish-file.sh", {
|
||||
env: {
|
||||
FILE: "test.html",
|
||||
BUILD: program.build,
|
@ -2,7 +2,7 @@
|
||||
"type": "application",
|
||||
"source-directories": [
|
||||
"src",
|
||||
"../../src"
|
||||
"../src"
|
||||
],
|
||||
"elm-version": "0.19.1",
|
||||
"dependencies": {
|
@ -3,12 +3,12 @@ module ClassNames exposing (suite)
|
||||
{-| -}
|
||||
|
||||
import Expect
|
||||
import Html
|
||||
import Internal.Flag as Flag
|
||||
import Html exposing (Html)
|
||||
import Internal.Style
|
||||
import Test
|
||||
import Test exposing (Test)
|
||||
|
||||
|
||||
suite : Test
|
||||
suite =
|
||||
Test.describe "Classname Collisions"
|
||||
[ Test.test "No duplicates" <|
|
||||
@ -17,6 +17,7 @@ suite =
|
||||
]
|
||||
|
||||
|
||||
main : Html msg
|
||||
main =
|
||||
Html.div []
|
||||
[ Html.text "The following names collide"
|
||||
@ -25,6 +26,7 @@ main =
|
||||
]
|
||||
|
||||
|
||||
viewPair : ( String, String ) -> Html msg
|
||||
viewPair ( name, description ) =
|
||||
Html.div []
|
||||
[ Html.text name
|
||||
|
@ -3,7 +3,6 @@ module Flags exposing (suite)
|
||||
{-| -}
|
||||
|
||||
import Expect
|
||||
import Html
|
||||
import Internal.Flag as Flag
|
||||
import Test
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user