Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
test: add build example tests and use circleci 2 (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau authored Mar 9, 2017
1 parent 540ecd9 commit a2fc681
Show file tree
Hide file tree
Showing 7 changed files with 289 additions and 211 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
jobs:
build:
working_directory: ~/vitaminjs
docker:
- image: kkarczmarczyk/node-yarn:6.9
steps:
- checkout
- run:
name: Dependencies
command: yarn install --no-progress && yarn link
- run:
name: Lint
command: yarn lint
- run:
name: Build examples
command: ls -1 examples | picard tests split | xargs -n 1 ./.circleci/test.sh

19 changes: 19 additions & 0 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

example="$1"

if [ -z "$example" ]
then
echo "more parallelism than tests"
else
echo "Testing $example"

cd "./examples/$example"
yarn install --no-progress
yarn link vitaminjs
yarn run clean
yarn run build
test -e build/server_bundle.js
NODE_ENV=production yarn run build
test -e build/server_bundle.js
fi
14 changes: 0 additions & 14 deletions circle.yml

This file was deleted.

3 changes: 2 additions & 1 deletion examples/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"version": "1.0.0",
"description": "vitamin counter example",
"scripts": {
"build": "vitamin build",
"start": "vitamin start",
"build": "vitamin build"
"serve": "vitamin serve"
},
"author": "Johan Girod <johan@evaneos.com>",
"repository": {
Expand Down
9 changes: 5 additions & 4 deletions examples/real-world-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"private": true,
"dependencies": {
"humps": "^1.1.0",
"lodash": "^4.16.1",
"lodash": "^4.17.4",
"normalizr": "3.0.0",
"react": "^15.4.2",
"vitaminjs": "../.."
"vitaminjs": "file:../.."
},
"scripts": {
"start": "vitaminjs start",
"build": "vitaminjs build"
"build": "vitamin build",
"start": "vitamin start",
"serve": "vitamin serve"
}
}
435 changes: 244 additions & 191 deletions examples/real-world-example/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The build toolchain against JavaScript Fatigue",
"main": "./src/shared/index.js",
"scripts": {
"test": "npm run lint",
"test": "yarn run lint",
"lint": "eslint --ext .js,.jsx src bin config"
},
"bin": {
Expand Down

0 comments on commit a2fc681

Please sign in to comment.