Skip to content

Commit

Permalink
Test ejecting of the flavor in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbruegge committed Oct 23, 2018
1 parent 460e287 commit d00e3da
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 25 deletions.
33 changes: 20 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
language: node_js
node_js:
- 6
- 8

notifications:
email: false

cache:
yarn: true
directories:
- node_modules
- /home/travis/.pnpm-store

before_install:
- npm install -g npm@5
- npm install -g yarn
- npm install -g greenkeeper-lockfile@1
- npm install -g create-cycle-app
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
script:
- create-cycle-app test-app --flavor $(pwd) --yarn
- cd test-app
- yarn run build
- yarn test
- cd ..
- npm install -g pnpm@^2.17.0

matrix:
include:
- script: ./runCI.sh yarn
node_js: 6
install: yarn install
- script: ./runCI.sh yarn
node_js: 8
install: yarn install
# - script: ./runCI.sh pnpm
# node_js: 6
# install: pnpm install
# - script: ./runCI.sh pnpm
# node_js: 8
# install: pnpm install
2 changes: 1 addition & 1 deletion configs/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const appPath = (...names) => path.join(process.cwd(), ...names);
const userConfig = require(appPath('webpack.config.js'));
const packageJson = require(appPath('package.json'));

const PORT = process.env.PORT || 8080
const PORT = process.env.PORT || 8080;

module.exports = webpackMerge(
createConfig([
Expand Down
13 changes: 13 additions & 0 deletions runCI.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

cli=$1

set -eu

create-cycle-app test-app --flavor $(pwd) "--$cli"
cd test-app
"$cli" run build
"$cli" test
echo "y\n" | "$cli" run eject
"$cli" run build
"$cli" test
6 changes: 1 addition & 5 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ let env = Object.create(process.env);
env.NODE_ENV = 'test';

const nycAPI = require.resolve('nyc');
const nyc = path.resolve(
path.dirname(nycAPI),
'bin',
'nyc.js'
);
const nyc = path.resolve(path.dirname(nycAPI), 'bin', 'nyc.js');

const args = [
'mocha-webpack',
Expand Down
10 changes: 4 additions & 6 deletions template/pnpmfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ module.exports = {

function readPackage(pkg, context) {
if (pkg['one-fits-all']) {
pkg.devDependencies = {
...pkg.devDependencies,
pkg.devDependencies = Object.assign({}, pkg.devDependencies, {
tslint: '*',
jsverify: '*',
webpack: '*',
Expand All @@ -24,12 +23,11 @@ function readPackage(pkg, context) {
'@types/history': '*',
'cross-env': '*',
'mocha-webpack': '2.0.0-beta.0'
};
pkg.dependencies = {
...pkg.dependencies,
});
pkg.dependencies = Object.assign({}, pkg.dependencies, {
snabbdom: '*',
history: '*'
};
});
}

return pkg;
Expand Down

0 comments on commit d00e3da

Please sign in to comment.