Skip to content
This repository was archived by the owner on Jun 17, 2021. It is now read-only.

Commit 39aaeb7

Browse files
committed
refactor test suite
1 parent 8396154 commit 39aaeb7

16 files changed

+1295
-1030
lines changed

.babelrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- '*'
8+
pull_request:
9+
types: [opened, reopened, synchronize]
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [8.x, 10.x, 12.x, 13.x]
16+
17+
steps:
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- uses: actions/checkout@v1
24+
- run: npm install
25+
- run: npm run test
26+
27+
- name: Upload coverage to Coveralls
28+
uses: coverallsapp/github-action@master
29+
with:
30+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ lib-cov
5151

5252
# Coverage directory used by tools like istanbul
5353
coverage
54+
.nyc_output
5455

5556
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
5657
.grunt

.travis.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SYNOPSIS
22

33
[![NPM Package](https://img.shields.io/npm/v/ethereumjs-util.svg?style=flat-square)](https://www.npmjs.org/package/ethereumjs-util)
4-
[![Build Status](https://img.shields.io/travis/ethereumjs/ethereumjs-util.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereumjs/ethereumjs-util)
4+
[![Actions Status](https://github.com/ethereumjs/ethereumjs-util/workflows/Build/badge.svg)](https://github.com/ethereumjs/ethereumjs-util/actions
55
[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethereumjs-util.svg?style=flat-square)](https://coveralls.io/r/ethereumjs/ethereumjs-util)
66
[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg?style=flat-square)](https://gitter.im/ethereum/ethereumjs-lib) or #ethereumjs on freenode
77

karma.conf.js

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,23 @@
1-
module.exports = function (config) {
1+
module.exports = function(config) {
22
config.set({
3-
frameworks: ['browserify', 'detectBrowsers', 'mocha'],
4-
files: [
5-
'test/*.js'
6-
],
3+
frameworks: ['mocha', 'karma-typescript'],
4+
files: ['src/**/*.ts', 'test/**/*.ts'],
75
preprocessors: {
8-
'test/*.js': ['browserify', 'env']
6+
'**/*.ts': ['karma-typescript'],
97
},
10-
singleRun: true,
11-
plugins: [
12-
'karma-browserify',
13-
'karma-chrome-launcher',
14-
'karma-env-preprocessor',
15-
'karma-firefox-launcher',
16-
'karma-detect-browsers',
17-
'karma-mocha'
18-
],
19-
browserify: {
20-
'transform': [
21-
[
22-
'babelify',
23-
{
24-
'presets': [
25-
'env'
26-
]
27-
}
28-
]
29-
],
30-
debug: true
8+
plugins: ['karma-mocha', 'karma-typescript', 'karma-chrome-launcher', 'karma-firefox-launcher'],
9+
karmaTypescriptConfig: {
10+
bundlerOptions: {
11+
entrypoints: /\.spec\.ts$/,
12+
},
3113
},
32-
envPreprocessor: [
33-
'RANDOM_TESTS_REPEAT',
34-
'TRAVIS'
35-
],
36-
detectBrowsers: {
37-
enabled: true,
38-
usePhantomJS: false,
39-
postDetection: function (availableBrowser) {
40-
if (availableBrowser.includes('Chrome')) {
41-
return ['ChromeHeadless']
42-
}
43-
44-
var browsers = ['Chrome', 'Firefox']
45-
return browsers.filter(function (browser) {
46-
return availableBrowser.indexOf(browser) !== -1
47-
})
48-
}
49-
}
14+
colors: true,
15+
reporters: ['progress', 'karma-typescript'],
16+
browsers: ['FirefoxHeadless', 'ChromeHeadless'],
17+
singleRun: true,
18+
concurrency: Infinity,
19+
// Fail after timeout
20+
browserDisconnectTimeout: 100000,
21+
browserNoActivityTimeout: 100000,
5022
})
5123
}

package.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@
1010
"scripts": {
1111
"build": "ethereumjs-config-build",
1212
"prepublishOnly": "npm run test && npm run build",
13-
"coverage": "npm run build && istanbul cover _mocha",
14-
"coveralls": "npm run coverage && coveralls <coverage/lcov.info",
1513
"docs:build": "typedoc --out docs --mode file --readme none --theme markdown --mdEngine github --gitRevision master --excludeNotExported src",
1614
"format": "ethereumjs-config-format",
1715
"format:fix": "ethereumjs-config-format-fix",
1816
"lint": "ethereumjs-config-lint",
1917
"lint:fix": "ethereumjs-config-lint-fix",
2018
"test": "npm run lint && npm run test:node && npm run test:browser",
21-
"test:browser": "npm run build && karma start karma.conf.js",
22-
"test:node": "npm run build && istanbul test mocha -- --reporter spec",
19+
"test:browser": "karma start karma.conf.js",
20+
"test:node": "nyc --reporter=lcov mocha 'test/*.spec.ts' -- --require ts-node/register",
2321
"tsc": "ethereumjs-config-tsc",
2422
"tslint": "ethereumjs-config-tslint",
2523
"tslint:fix": "ethereumjs-config-tslint-fix"
@@ -100,24 +98,19 @@
10098
"@ethereumjs/config-prettier": "^1.1.0",
10199
"@ethereumjs/config-tsc": "^1.1.0",
102100
"@ethereumjs/config-tslint": "^1.1.0",
101+
"@types/mocha": "^5.2.7",
103102
"@types/node": "^11.9.0",
104-
"babel-cli": "^6.26.0",
105-
"babel-preset-env": "^1.6.1",
106-
"babelify": "^8.0.0",
107-
"browserify": "^14.0.0",
108103
"contributor": "^0.1.25",
109-
"coveralls": "^3.0.0",
110104
"husky": "^2.1.0",
111-
"istanbul": "^0.4.1",
112105
"karma": "^4.0.0",
113-
"karma-browserify": "^5.0.0",
114106
"karma-chrome-launcher": "^2.0.0",
115-
"karma-detect-browsers": "2.2.6",
116-
"karma-env-preprocessor": "^0.1.1",
117107
"karma-firefox-launcher": "^1.0.0",
118108
"karma-mocha": "^1.3.0",
109+
"karma-typescript": "^4.1.1",
119110
"mocha": "^6.0.0",
111+
"nyc": "^15.0.0",
120112
"prettier": "^1.15.3",
113+
"ts-node": "^8.6.2",
121114
"tslint": "^5.12.0",
122115
"typedoc": "^0.14.0",
123116
"typedoc-plugin-markdown": "^1.1.21",

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import BN = require('bn.js')
2+
const Buffer = require('buffer').Buffer
23

34
/**
45
* The max integer that this VM can handle

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy