Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Aug 23, 2022
1 parent d696a34 commit 746178e
Show file tree
Hide file tree
Showing 12 changed files with 9,741 additions and 18,493 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@ module.exports = {
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'no-console': 1,
'import/no-named-as-default': 0,
// https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/order.md
'import/order': ['error', { 'newlines-between': 'always-and-inside-groups' }],
'import/order': ['error', { 'newlines-between': 'always' }],
'import/newline-after-import': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
process.env.NODE_ENV === 'production' ? 2 : 1,
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '40 7,19 * * *'
workflow_dispatch:

jobs:
test:
runs-on: macos-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2
with:
submodules: true

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2-beta
with:
node-version: '14'

- name: Install deps
run: npm i --ignore-scripts && npm i -D puppeteer

- name: Test
run: npm run test
5 changes: 5 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', 'src/bridge'],
};
Loading

0 comments on commit 746178e

Please sign in to comment.