-
Notifications
You must be signed in to change notification settings - Fork 274
Refactor test suite #231
Refactor test suite #231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [8.x, 10.x, 12.x, 13.x] | ||
|
||
steps: | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- uses: actions/checkout@v1 | ||
- run: npm install | ||
- run: npm run test | ||
|
||
- name: Upload coverage to Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,23 @@ | ||
module.exports = function (config) { | ||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['browserify', 'detectBrowsers', 'mocha'], | ||
files: [ | ||
'test/*.js' | ||
], | ||
frameworks: ['mocha', 'karma-typescript'], | ||
files: ['src/**/*.ts', 'test/**/*.ts'], | ||
preprocessors: { | ||
'test/*.js': ['browserify', 'env'] | ||
'**/*.ts': ['karma-typescript'], | ||
}, | ||
singleRun: true, | ||
plugins: [ | ||
'karma-browserify', | ||
'karma-chrome-launcher', | ||
'karma-env-preprocessor', | ||
'karma-firefox-launcher', | ||
'karma-detect-browsers', | ||
'karma-mocha' | ||
], | ||
browserify: { | ||
'transform': [ | ||
[ | ||
'babelify', | ||
{ | ||
'presets': [ | ||
'env' | ||
] | ||
} | ||
] | ||
], | ||
debug: true | ||
plugins: ['karma-mocha', 'karma-typescript', 'karma-chrome-launcher', 'karma-firefox-launcher'], | ||
karmaTypescriptConfig: { | ||
bundlerOptions: { | ||
entrypoints: /\.spec\.ts$/, | ||
}, | ||
}, | ||
envPreprocessor: [ | ||
'RANDOM_TESTS_REPEAT', | ||
'TRAVIS' | ||
], | ||
detectBrowsers: { | ||
enabled: true, | ||
usePhantomJS: false, | ||
postDetection: function (availableBrowser) { | ||
if (availableBrowser.includes('Chrome')) { | ||
return ['ChromeHeadless'] | ||
} | ||
|
||
var browsers = ['Chrome', 'Firefox'] | ||
return browsers.filter(function (browser) { | ||
return availableBrowser.indexOf(browser) !== -1 | ||
}) | ||
} | ||
} | ||
colors: true, | ||
reporters: ['progress', 'karma-typescript'], | ||
browsers: ['FirefoxHeadless', 'ChromeHeadless'], | ||
singleRun: true, | ||
concurrency: Infinity, | ||
// Fail after timeout | ||
browserDisconnectTimeout: 100000, | ||
browserNoActivityTimeout: 100000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add some notes on the config you changed here together with some reasoning along? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I grabbed some of the sensible defaults that were being used in ethereumjs-vm/karma.conf.js. I was going to bring over the comments indicating what each line does but decided not to for brevity, next time I will. Thanks! |
||
}) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,14 @@ | |
"scripts": { | ||
"build": "ethereumjs-config-build", | ||
"prepublishOnly": "npm run test && npm run build", | ||
"coverage": "npm run build && istanbul cover _mocha", | ||
"coveralls": "npm run coverage && coveralls <coverage/lcov.info", | ||
"docs:build": "typedoc --out docs --mode file --readme none --theme markdown --mdEngine github --gitRevision master --excludeNotExported src", | ||
"format": "ethereumjs-config-format", | ||
"format:fix": "ethereumjs-config-format-fix", | ||
"lint": "ethereumjs-config-lint", | ||
"lint:fix": "ethereumjs-config-lint-fix", | ||
"test": "npm run lint && npm run test:node && npm run test:browser", | ||
"test:browser": "npm run build && karma start karma.conf.js", | ||
"test:node": "npm run build && istanbul test mocha -- --reporter spec", | ||
"test:browser": "karma start karma.conf.js", | ||
"test:node": "nyc --reporter=lcov mocha 'test/*.spec.ts' -- --require ts-node/register", | ||
"tsc": "ethereumjs-config-tsc", | ||
"tslint": "ethereumjs-config-tslint", | ||
"tslint:fix": "ethereumjs-config-tslint-fix" | ||
|
@@ -100,24 +98,19 @@ | |
"@ethereumjs/config-prettier": "^1.1.0", | ||
"@ethereumjs/config-tsc": "^1.1.0", | ||
"@ethereumjs/config-tslint": "^1.1.0", | ||
"@types/mocha": "^5.2.7", | ||
"@types/node": "^11.9.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babelify": "^8.0.0", | ||
"browserify": "^14.0.0", | ||
"contributor": "^0.1.25", | ||
"coveralls": "^3.0.0", | ||
"husky": "^2.1.0", | ||
"istanbul": "^0.4.1", | ||
"karma": "^4.0.0", | ||
"karma-browserify": "^5.0.0", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-detect-browsers": "2.2.6", | ||
"karma-env-preprocessor": "^0.1.1", | ||
"karma-firefox-launcher": "^1.0.0", | ||
"karma-mocha": "^1.3.0", | ||
"karma-typescript": "^4.1.1", | ||
"mocha": "^6.0.0", | ||
"nyc": "^15.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record: switched from |
||
"prettier": "^1.15.3", | ||
"ts-node": "^8.6.2", | ||
"tslint": "^5.12.0", | ||
"typedoc": "^0.14.0", | ||
"typedoc-plugin-markdown": "^1.1.21", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import BN = require('bn.js') | ||
const Buffer = require('buffer').Buffer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I needed to include this for the source to compile correctly for browsers in the karma test runner. |
||
|
||
/** | ||
* The max integer that this VM can handle | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record: this PR removes support for Node 11 and adds support for Node 13.