diff --git a/.github/workflows/cdm-ci.yaml b/.github/workflows/cdm-ci.yaml index 24153bc2..0ebffd3b 100644 --- a/.github/workflows/cdm-ci.yaml +++ b/.github/workflows/cdm-ci.yaml @@ -33,28 +33,36 @@ jobs: - uses: actions/setup-node@v3 with: node-version: "18" + - name: enforce javascript style standard run: npx prettier **/*.js --check env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python - uses: actions/setup-python@v4 + - name: code coverage + uses: ArtiomTr/jest-coverage-report-action@v2 + id: coverage with: - python-version: 3.9 + output: report-markdown + working-directory: queries - - name: install html to markdown converter - run: pip install html2text + # - name: Set up Python + # uses: actions/setup-python@v4 + # with: + # python-version: 3.9 - - name: check unit tests - run: npm test --prefix=queries --coverageDirectory=coverage + # - name: install html to markdown converter + # run: pip install html2text - - name: convert test coverage to markdown - run: html2text --ignore-image --ignore-links -b 0 queries/coverage/lcov-report/index.html >> $GITHUB_STEP_SUMMARY + # - name: check unit tests + # run: npm test --prefix=queries --coverageDirectory=coverage - - name: upload coverage html artifact - uses: actions/upload-artifact@v3 - with: - name: coverage - path: queries/coverage - if-no-files-found: error \ No newline at end of file + # - name: convert test coverage to markdown + # run: html2text --ignore-image --ignore-links -b 0 queries/coverage/lcov-report/index.html >> $GITHUB_STEP_SUMMARY + + # - name: upload coverage html artifact + # uses: actions/upload-artifact@v3 + # with: + # name: coverage + # path: queries/coverage + # if-no-files-found: error \ No newline at end of file diff --git a/queries/test/cdm.test.js b/queries/test/cdm.test.js index 75354834..35f9f6db 100644 --- a/queries/test/cdm.test.js +++ b/queries/test/cdm.test.js @@ -1,4 +1,5 @@ const { describe, expect, test } = require('@jest/globals'); + const cdm = require('../cdmq/cdm.js'); describe('set(ish)-array behavior', () => { @@ -27,5 +28,34 @@ describe('set(ish)-array behavior', () => { }); }); +// const { t } = require('tap'); + +// t.test('set(ish) difference (subtractTwoArrays)', t => { +// a0 = [1, 1, 2]; +// a1 = [2, 2, 3]; + +// t.matchOnlyStrict(cdm.subtractTwoArrays(a0, a1), [1, 1]); +// t.matchOnlyStrict(cdm.subtractTwoArrays(a1, a0), [3]); +// t.end(); +// }); + +// t.test('set(ish) intersection (intersectTwoArrays)', t => { +// a0 = [1, 1, 2]; +// a1 = [2, 2, 3]; + +// t.matchOnlyStrict(cdm.intersectTwoArrays(a0, a1), [2]); +// t.matchOnlyStrict(cdm.intersectTwoArrays(a1, a0), [2, 2]); +// t.end(); +// }); + +// t.test('intersect all arrays', t => { +// a0 = [1, 1, 2]; +// a1 = [2, 2, 3]; +// a2 = [4, 4, 2]; +// a = [a0, a1, a2]; +// t.matchOnlyStrict(cdm.intersectAllArrays(a), [2]); +// t.end() +// }); +