Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #733 from LiskHQ/718-lisk-constants-reorganize-bro…
Browse files Browse the repository at this point in the history
…wsertest

Reorganize symlink structure & scripts for all packages - closes #718-722
  • Loading branch information
willclarktech authored Jul 23, 2018
2 parents 185acf6 + e26d4d1 commit c5918b9
Show file tree
Hide file tree
Showing 83 changed files with 329 additions and 138 deletions.
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ test/.coverage-unit
.nyc_output

# cypress media
**/cypress/screenshots/
**/cypress/videos/
**/cypress/plugins/
**/cypress/support/
templates/cypress.tmpl/screenshots/
templates/cypress.tmpl/videos/
templates/cypress.tmpl/plugins/
templates/cypress.tmpl/support/

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand All @@ -53,8 +53,9 @@ jspm_packages
tmp

# Distribution folders
dist-browser/
dist-node/
dist-browser/
browsertest.build/

# Unsupported lock files
yarn.lock
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
5 changes: 0 additions & 5 deletions .nycrc

This file was deleted.

1 change: 1 addition & 0 deletions .nycrc
5 changes: 0 additions & 5 deletions .prettierrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.json
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ pipeline {
}
}
}
stage('Run node tests') {
steps {
ansiColor('xterm') {
sh 'npm run test:node'
}
}
}
stage('Run browser tests') {
steps {
sh '''
npm run build:browsertest
npm run test:browser
'''
}
}
}
post {
success {
Expand Down
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"lerna": "2.11.0",
"packages": ["packages/*"],
"version": "independent"
"version": "independent",
"stream": true
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"test": "lerna run test",
"test:node": "lerna run test:node",
"test:browser": "lerna run test:browser",
"build": "lerna run build",
"build:browsertest": "lerna run build:browsertest",
"cover": "lerna run cover",
"postinstall": "npm run bootstrap",
"precommit": "lint-staged && npm run lint",
Expand Down
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.babelrc
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.eslintignore
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.npmignore
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.npmrc
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.nycrc
2 changes: 1 addition & 1 deletion packages/lisk-api-client/.prettierrc.json
1 change: 1 addition & 0 deletions packages/lisk-api-client/browsertest
24 changes: 0 additions & 24 deletions packages/lisk-api-client/browsertest/config.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/lisk-api-client/cypress
4 changes: 0 additions & 4 deletions packages/lisk-api-client/cypress.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/lisk-api-client/cypress.json
32 changes: 20 additions & 12 deletions packages/lisk-api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"scripts": {
"transpile": "babel src -d dist-node",
"transpile:browsertest":
"babel src -d ./browsertest/src && BABEL_ENV=browsertest babel test -d ./browsertest/test",
"babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test",
"browserify":
"browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node",
"browserify:browsertest":
"browserify ./browsertest/test/*.js ./browsertest/test/**/*.js -o ./browsertest/browsertest.js -s lisk",
"browserify ./browsertest.build/test/*.js ./browsertest.build/test/**/*.js -o ./browsertest.build/browsertest.js -s lisk",
"uglify":
"uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js",
"uglify:browsertest":
"uglifyjs -o ./browsertest/browsertest.min.js ./browsertest/browsertest.js",
"uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js",
"format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
Expand All @@ -41,23 +41,30 @@
"test:watch:min": "npm run test:watch -- --reporter=min",
"test:node":
"npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive",
"test:browser": "cypress run --env ROOT_DIR=\"${PWD##*/}\"",
"serve:browsertest": "http-server browsertest",
"serve:start": "http-server -p 11541 ./browsertest &",
"serve:stop": "kill $(lsof -t -i:11541) || true",
"pretest:browser":
"npm run serve:stop && npm run build:browsertest && npm run serve:start",
"test:browser":
"wait-on http://localhost:11541 && cypress run --config baseUrl=http://localhost:11541 --env ROOT_DIR=\"${PWD##*/}\"",
"posttest:browser": "npm run serve:stop",
"cover":
"if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi",
"cover:base": "NODE_ENV=test nyc report",
"cover:local": "npm run cover:base -- --reporter=html --reporter=text",
"cover:ci": "npm run cover:base -- --reporter=text",
"build:browsertest":
"npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest",
"postbuild:browsertest": "rm -r browsertest/src browsertest/test",
"prebuild:node": "rm -r dist-node/* || mkdir dist-node | echo",
"postbuild:browsertest":
"rm -r browsertest.build/src browsertest.build/test",
"prebuild:node": "rm -r dist-node/* || mkdir dist-node || true",
"build:node": "npm run transpile",
"prebuild:browser":
"rm ./dist-browser/index.js ./dist-browser/index.min.js | echo",
"build:browser": "npm run browserify && npm run uglify",
"prebuild": "npm run prebuild:node && npm run prebuild:browser",
"build": "npm run build:node && npm run build:browser",
"rm ./dist-browser/index.js ./dist-browser/index.min.js || true",
"build:browser":
"npm run build:node && npm run browserify && npm run uglify",
"prebuild": "npm run prebuild:browser",
"build": "npm run build:browser",
"build:check": "node -e \"require('./dist-node')\"",
"prepublishOnly":
"npm run lint && npm test && npm run build && npm run build:check"
Expand Down Expand Up @@ -88,6 +95,7 @@
"prettier": "1.12.1",
"sinon": "4.1.2",
"sinon-chai": "2.14.0",
"uglify-es": "3.3.9"
"uglify-es": "3.3.9",
"wait-on": "2.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/lisk-constants/.babelrc
2 changes: 1 addition & 1 deletion packages/lisk-constants/.eslintignore
2 changes: 1 addition & 1 deletion packages/lisk-constants/.npmignore
2 changes: 1 addition & 1 deletion packages/lisk-constants/.npmrc
2 changes: 1 addition & 1 deletion packages/lisk-constants/.nycrc
2 changes: 1 addition & 1 deletion packages/lisk-constants/.prettierrc.json
1 change: 1 addition & 0 deletions packages/lisk-constants/browsertest
1 change: 1 addition & 0 deletions packages/lisk-constants/cypress
1 change: 1 addition & 0 deletions packages/lisk-constants/cypress.json
44 changes: 40 additions & 4 deletions packages/lisk-constants/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,55 @@
"node": ">=6.3 <=9.5",
"npm": ">=3 <=5"
},
"browser": "dist-browser/index.min.js",
"main": "dist-node/index.js",
"scripts": {
"transpile": "babel src -d dist-node",
"transpile:browsertest":
"babel src -d ./browsertest.build/src && BABEL_ENV=browsertest babel test -d ./browsertest.build/test",
"browserify":
"browserify ./dist-node/index.js -o ./dist-browser/index.js -s lisk --node",
"browserify:browsertest":
"browserify ./browsertest.build/test/*.js -o ./browsertest.build/browsertest.js -s lisk",
"uglify":
"uglifyjs -nm -o ./dist-browser/index.min.js ./dist-browser/index.js",
"uglify:browsertest":
"uglifyjs -o ./browsertest.build/browsertest.min.js ./browsertest.build/browsertest.js",
"format": "prettier --write \"*.{js,json}\" \"{src,test}/**/*.{js,json}\"",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"test": "NODE_ENV=test nyc mocha test",
"test:watch": "npm test -- --watch",
"test:watch:min": "npm run test:watch -- --reporter=min",
"test:node":
"npm run build:check && BABEL_ENV=buildcheck mocha test --compilers js:babel-register --recursive",
"serve:start": "http-server -p 11542 ./browsertest &",
"serve:stop": "kill $(lsof -t -i:11542) || true",
"pretest:browser":
"npm run serve:stop && npm run build:browsertest && npm run serve:start",
"test:browser":
"wait-on http://localhost:11542 && cypress run --config baseUrl=http://localhost:11542 --env ROOT_DIR=\"${PWD##*/}\"",
"posttest:browser": "npm run serve:stop",
"cover":
"if [ -z $JENKINS_HOME ]; then npm run cover:local; else npm run cover:ci; fi",
"cover:base": "NODE_ENV=test nyc report",
"cover:local": "npm run cover:base -- --reporter=html --reporter=text",
"cover:ci": "npm run cover:base -- --reporter=text",
"prebuild": "rm -r dist-node || mkdir dist-node | echo",
"build": "babel src -d dist-node",
"build:browsertest":
"npm run transpile:browsertest && npm run browserify:browsertest && npm run uglify:browsertest",
"postbuild:browsertest":
"rm -r browsertest.build/src browsertest.build/test",
"prebuild:node": "rm -r dist-node/* || mkdir dist-node || true",
"build:node": "npm run transpile",
"prebuild:browser":
"rm ./dist-browser/index.js ./dist-browser/index.min.js || true",
"build:browser":
"npm run build:node && npm run browserify && npm run uglify",
"prebuild": "npm run prebuild:browser",
"build": "npm run build:browser",
"build:check": "node -e \"require('./dist-node')\"",
"prepublishOnly":
"rm -r ./node_modules && npm install && npm run lint && npm test && npm run build && npm run build:check"
"npm run lint && npm test && npm run build && npm run build:check"
},
"devDependencies": {
"babel-cli": "6.26.0",
Expand All @@ -45,14 +76,19 @@
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.6.1",
"babel-register": "6.26.0",
"browserify": "16.2.2",
"chai": "4.1.2",
"cypress": "3.0.2",
"eslint": "4.19.1",
"eslint-config-airbnb-base": "12.1.0",
"eslint-config-lisk-base": "1.0.0",
"eslint-plugin-import": "2.11.0",
"eslint-plugin-mocha": "5.0.0",
"http-server": "0.11.1",
"mocha": "5.1.1",
"nyc": "11.7.1",
"prettier": "1.12.1"
"prettier": "1.12.1",
"uglify-es": "3.3.9",
"wait-on": "2.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.babelrc
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.eslintignore
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.npmignore
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.npmrc
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.nycrc
2 changes: 1 addition & 1 deletion packages/lisk-cryptography/.prettierrc.json
1 change: 1 addition & 0 deletions packages/lisk-cryptography/browsertest
1 change: 1 addition & 0 deletions packages/lisk-cryptography/cypress
1 change: 1 addition & 0 deletions packages/lisk-cryptography/cypress.json
Loading

0 comments on commit c5918b9

Please sign in to comment.