From 73a7cfa6e14af781ea77f7dbe4a88638f7f3ec74 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Wed, 22 Feb 2023 22:21:45 -0500 Subject: commit package-lock While the majority of use will likely not use npm, those that do will likely lock to particular versions. Once we have a lockfile, we'll be able to more easily jump to "old" versions and reproduce installation or compatibility issues. And with dependabot, we'll be able to still stay "fresh" and not worry about developer environments masking issues by not pulling newer versions. --- .gitignore | 1 - package-lock.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 418531e..41a3ee1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /node_modules -/package-lock.json /yarn.lock /bats-assert-*.tgz diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..8f0dcc6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,36 @@ +{ + "name": "bats-assert", + "version": "2.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bats-assert", + "version": "2.1.0", + "license": "CC0-1.0", + "devDependencies": { + "bats": "^1", + "bats-support": "^0.3" + }, + "peerDependencies": { + "bats": "0.4 || ^1", + "bats-support": "^0.3" + } + }, + "node_modules/bats": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/bats/-/bats-1.9.0.tgz", + "integrity": "sha512-Z5BJaAmmHv/ujj7obhjEzJ//OL+ZtjVq0iRnHu+2fE9OeUaPMbJpBgYiOdNbDrG3E2hqe84/AXNnS/UiXl/UcA==", + "dev": true, + "bin": { + "bats": "bin/bats" + } + }, + "node_modules/bats-support": { + "version": "0.3.0", + "resolved": "git+ssh://git@github.com/jasonkarns/bats-support.git#24a72e14349690bcbf7c151b9d2d1cdd32d36eb1", + "integrity": "sha512-42f2THEaN02dVj7Zhj0C4AM5FdePq3YPlXvnu/fKUQwCv1qM2dyACBKFXQkLw9QMzhDmwuFcke90XwHMUsBjGQ==", + "dev": true + } + } +} -- cgit v1.2.3 From 1950e8cb6cfa464a3b57b1dbc21e3413b3600e94 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 23 Feb 2023 08:57:15 -0500 Subject: Replace inline tests workflow with reusable call --- .github/workflows/test.yml | 9 +++++++++ .github/workflows/tests.yml | 26 -------------------------- 2 files changed, 9 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6c95ce2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,9 @@ +name: Test +on: + push: + pull_request: + workflow_dispatch: + +jobs: + test: + uses: bats-core/.github/.github/workflows/test.yml@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index ad332f0..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Tests - -on: - push: - workflow_dispatch: - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - run: npm install - - run: BATS_LIB_PATH="$PWD/node_modules" npm test -- cgit v1.2.3 From effe6f58f839404f5935154b28565d0c4adf6977 Mon Sep 17 00:00:00 2001 From: Jason Karns Date: Thu, 23 Feb 2023 08:57:26 -0500 Subject: set bats_lib_path in test helper The installation mechanism of dependencies is unique to a project, and so the configuration of BATS_LIB_PATH should be owned by the test suite, not assumed set as an outside env var. --- test/test_helper.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_helper.bash b/test/test_helper.bash index beb9298..8d476a8 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -1,4 +1,5 @@ # Load dependencies. +BATS_LIB_PATH=$PWD/node_modules:${BATS_LIB_PATH-} bats_load_library 'bats-support' # Load library. -- cgit v1.2.3