Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.19 tests #1

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = {
exclude: [/elm-stuff/, /node_modules/],
use: [
{
loader: require.resolve('elm-hot-loader')
loader: require.resolve('elm-hot-webpack-loader')
},
// string-replace-loader works as InterpolateHtmlPlugin for Elm,
// it replaces all of the %PUBLIC_URL% with the URL of your
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"css-loader": "^0.28.9",
"dotenv": "^5.0.0",
"elm": "0.19.0-bugfix2",
"elm-hot-loader": "0.5.4",
"elm-hot-webpack-loader": "^1.0.0",
"elm-test": "^0.19.0-beta4",
"elm-webpack-loader": "^5.0.0",
"extract-text-webpack-plugin": "^3.0.2",
Expand Down Expand Up @@ -96,7 +96,8 @@
"test": "npm run test:cli && npm run test:functional",
"test:cli": "mocha tests/cliAccessibility.js --reporter spec --timeout 15000",
"test:functional": "mocha tests/*.spec.js --reporter spec --timeout 15000",
"build": "cd template && node ../bin/elm-app-cli.js build",
"start": "cd template && node ../bin/elm-app-cli.js start"
"app:build": "cd template && node ../bin/elm-app-cli.js build",
"app:start": "cd template && node ../bin/elm-app-cli.js start",
"app:test": "cd template && node ../bin/elm-app-cli.js test"
}
}
2 changes: 1 addition & 1 deletion scripts/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function createElmApp(name) {
// Run initial `elm make`
const spawnElmPkgResult = spawnSync(
path.resolve(__dirname, '../node_modules/.bin/elm'),
['make', 'src/Main.elm'],
['make', 'src/Main.elm', '--output=/dev/null'],
{ stdio: 'inherit' }
);

Expand Down
7 changes: 4 additions & 3 deletions template/src/Main.elm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Main exposing (..)

import Browser
import Html exposing (Html, text, div, h1, img)
import Html.Attributes exposing (src)

Expand Down Expand Up @@ -45,11 +46,11 @@ view model =
---- PROGRAM ----


main : Program Never Model Msg
main : Program () Model Msg
main =
Html.program
Browser.element
{ view = view
, init = init
, init = \_ -> init
, update = update
, subscriptions = always Sub.none
}
6 changes: 4 additions & 2 deletions template/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import './main.css';
import { Main } from './Main.elm';
import { Elm } from './Main.elm';
import registerServiceWorker from './registerServiceWorker';

Main.embed(document.getElementById('root'));
Elm.Main.init({
node: document.getElementById('root')
});

registerServiceWorker();
3 changes: 0 additions & 3 deletions tests/build.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/* eslint-disable */
/* eslint-env mocha */
const fs = require('fs');
const path = require('path');
const spawn = require('cross-spawn');
const rimraf = require('rimraf');
Expand Down
1 change: 0 additions & 1 deletion tests/cliAccessibility.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env mocha */
const expect = require('unexpected');
const spawn = require('cross-spawn');

Expand Down
3 changes: 1 addition & 2 deletions tests/create-elm-app.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env mocha */
const path = require('path');
const expect = require('unexpected');
const spawn = require('cross-spawn');
Expand Down Expand Up @@ -36,7 +35,7 @@ describe('Create Elm application with `create-elm-app` command', () => {
it(`'${testAppName}' should have the same file structure as template`, () => {
const templateDir = path.join(rootDir, 'template');
const options = {
excludeFilter: 'elm-stuff, elm.json, gitignore, .gitignore'
excludeFilter: 'elm-stuff, elm.json, gitignore, .gitignore, build'
};
const { same } = dircompare.compareSync(templateDir, testAppDir, options);
expect(same, 'to be', true);
Expand Down
1 change: 0 additions & 1 deletion tests/elm-app.build.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env mocha */
const fs = require('fs');
const path = require('path');
const spawn = require('cross-spawn');
Expand Down
1 change: 0 additions & 1 deletion tests/elm-app.eject.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env mocha */
const fs = require('fs');
const path = require('path');
const expect = require('unexpected');
Expand Down
1 change: 0 additions & 1 deletion tests/elm-app.test.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-env mocha */
const path = require('path');
const spawn = require('cross-spawn');
const rimraf = require('rimraf');
Expand Down