Skip to content

Commit

Permalink
add integration test for imports
Browse files Browse the repository at this point in the history
  • Loading branch information
0xngmi committed Jul 13, 2023
1 parent de960b5 commit 381f78c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/integrationTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test_Integration
on:
push:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Run changed files through test script
run: |
npm i
npm install -g ts-node
ts-node ${{ github.workspace }}/.github/workflows/testImports.ts
env:
ETHEREUM_RPC: ETHEREUM_RPC
9 changes: 9 additions & 0 deletions .github/workflows/testImports.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { readdirSync } from "fs"

function getDirectories(source: string) {
return readdirSync(source, { withFileTypes: true })
.map(dirent => dirent.name)
}

const emission_keys = getDirectories(`./protocols`)
Promise.all(emission_keys.map(k=>import(`../../protocols/${k}`)))

0 comments on commit 381f78c

Please sign in to comment.