From e88da6d2d77b80ce658eb9a8cf7d30bf7c687f9a Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Fri, 31 Mar 2023 13:12:16 -0400 Subject: [PATCH] Run JS lint/tests --- .github/workflows/ci.yml | 16 +++++++++++++++- packages/expressions/examples/index.js | 2 +- packages/expressions/schemas/index.js | 8 ++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a8f829e..d6116fcbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: [push, pull_request] jobs: - test: + ruby: name: Test on ruby ${{ matrix.ruby }} and rails ${{ matrix.rails }} runs-on: ubuntu-latest services: @@ -62,3 +62,17 @@ jobs: bundler-cache: true # 'bundle install' and cache gems - name: Run Rake with Rails ${{ matrix.rails }} run: bundle exec rake + js: + name: JS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'yarn' + cache-dependency-path: packages/expressions/yarn.json + - name: Run yarn lint + test + run: | + cd packages/expressions + yarn lint + yarn test diff --git a/packages/expressions/examples/index.js b/packages/expressions/examples/index.js index adcde4d79..e078e9457 100644 --- a/packages/expressions/examples/index.js +++ b/packages/expressions/examples/index.js @@ -1,6 +1,6 @@ import { basename } from 'path' -const modules = import.meta.glob("./*.json", { eager: true, import: 'default' }) +const modules = import.meta.glob('./*.json', { eager: true, import: 'default' }) export default Object.fromEntries(Object.entries(modules).map(([path, module]) => { return [basename(path, '.json'), module] diff --git a/packages/expressions/schemas/index.js b/packages/expressions/schemas/index.js index 61bdcc4bb..0817fd3cf 100644 --- a/packages/expressions/schemas/index.js +++ b/packages/expressions/schemas/index.js @@ -1,7 +1,7 @@ const modules = import.meta.glob('./*.json', { eager: true, import: 'default' }) const schemas = Object.fromEntries(Object.entries(modules).map(([path, module]) => { - const name = path.split('/').pop().split('.').shift(); - return [name == 'schema' ? 'default' : name, module]; -})); + const name = path.split('/').pop().split('.').shift() + return [name === 'schema' ? 'default' : name, module] +})) -export default schemas; +export default schemas