This repo demos how
plays together.
Minimal lasso
config and few basic test with nyc coverage included.
You need to ensure that chrome based mocha tests can run in your envitonment.
For start take a look at the puppeteer
project.
Tested with node:8.8.1-slim
docker based docker image on debian 8.9
host. Dockerfile
included.
- Clone the repo
$ git clone https://github.com/lependu/marko-boilerplate
$ cd marko-boilerplate
- Build the container:
$ docker build -t [image-name] .
- Install dependencies:
$ docker run -ti [--rm] -v $(pwd):/home/node/app -p [host-port]:8080 [image-name] -c "npm install"
- Run the container:
$ docker run -ti [--rm] -v $(pwd):/home/node/app -p [host-port]:8080 [image-name] -c "npm run [start|build|serve|lint|test]"
Be advised that the image size is ~ 600Mb + it will take ~400Mb more in the ./node_modules
after install.
I am not intend to test it in Windows or Mac environments, but any PR appreciated.
$ npm start
Start the server in production mode (minification enabled, etc.):
$ NODE_ENV=production npm start
Build the project in production mode:
$ npm run build
$ npm run lint
Eslint
$ npm run test
Test with mocha.
$ npm run coverage
Generates istanbul coverage report into coverage
directory.
For further configuration take a look at the .nycrc
file.
I could not make Element.click()
test to work. I guess it is related with
this or
this
puppeteer issue. Any help appreciated.
The [email protected]
has [email protected]
dependency,
while [email protected]
has [email protected]
dependency.
Thats why we have to add "lasso": "*"
in the package.json
Which is a bit messy, but works...
Which works until you $ npm i ...
something. After that you have to
$ npm i [email protected]
before run marko-starter
commands and
$ npm i lasso@2
before run tests.