Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #36

Merged
merged 11 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
extends: ["@toruslabs/eslint-config-node"],
parser: "@typescript-eslint/parser",
ignorePatterns: ["*.config.js", ".eslintrc.js"],
parserOptions: {
sourceType: "module",
ecmaVersion: 11,
project: "./tsconfig.json",
},
globals: {
document: true,
fetch: true,
jest: true,
it: true,
beforeEach: true,
afterEach: true,
describe: true,
},
};
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Run tests

on:
push:
branches-ignore:
- 'master'

name: CI

jobs:
test:
name: run tests
strategy:
matrix:
node: ["20.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

- name: Run tests
run: npm run test:ci
35 changes: 35 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Run tests

on:
push:
branches: [master]

name: Master

jobs:
test:
name: run tests
strategy:
matrix:
node: ["20.x"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "npm"

- name: Install dependencies
run: npm install

- name: Run build
run: npm run build

- name: Run tests
run: npm run test:ci
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
>=18.x
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eccrypto [![Build Status](https://travis-ci.org/bitchan/eccrypto.svg?branch=master)](https://travis-ci.org/bitchan/eccrypto)
# eccrypto [![Build Status](https://github.com/torusresearch/eccrypto/workflows/master/badge.svg)](https://github.com/torusresearch/eccrypto/actions)

[![NPM](https://nodei.co/npm/eccrypto.png)](https://www.npmjs.com/package/eccrypto)

Expand Down
5 changes: 1 addition & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
module.exports = {
"presets": ["@babel/env", "@babel/typescript"],
"plugins": ["@babel/plugin-proposal-object-rest-spread", "@babel/plugin-proposal-class-properties", "@babel/transform-runtime"]
}
module.exports = require("@toruslabs/config/babel.config");
9 changes: 8 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-extraneous-dependencies
const playwright = require("playwright");

process.env.FIREFOX_BIN = playwright.firefox.executablePath();
process.env.CHROME_BIN = playwright.chromium.executablePath();
process.env.WEBKIT_HEADLESS_BIN = playwright.webkit.executablePath();

module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
Expand Down Expand Up @@ -39,7 +46,7 @@ module.exports = function (config) {

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ["Chrome", "Firefox", "Safari"],
browsers: ["ChromeHeadless", "FirefoxHeadless"],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
Expand Down
Loading