From b51afc59c7526844c1294b647ecffba8ea4ff9ce Mon Sep 17 00:00:00 2001 From: Will Rowe Date: Tue, 14 Jun 2022 10:11:42 -0400 Subject: [PATCH 1/2] Fix xo error --- src/twig.lib.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/twig.lib.js b/src/twig.lib.js index b22b3274..41d93ee9 100644 --- a/src/twig.lib.js +++ b/src/twig.lib.js @@ -50,6 +50,7 @@ module.exports = function (Twig) { const searchEscaped = search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); return stringToChange.replace(new RegExp(searchEscaped, 'g'), replace); }; + // Chunk an array (arr) into arrays of (size) items, returns an array of arrays, or an empty array on invalid input Twig.lib.chunkArray = function (arr, size) { const returnVal = []; From ef0317c583fa6550b4b0f6d60b015be0d6b19cf2 Mon Sep 17 00:00:00 2001 From: Will Rowe Date: Wed, 22 Jun 2022 13:57:48 -0400 Subject: [PATCH 2/2] Add workflow to run tests on pull requests --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..8815b518 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: "tests" + +on: + push: + pull_request: + +jobs: + tests: + name: "Node v${{ matrix.node_js }}" + + runs-on: "ubuntu-latest" + + strategy: + fail-fast: true + matrix: + node_js: + - 10 + - 11 + - 12 + - 13 + + steps: + - name: "Checkout code" + uses: "actions/checkout@v2" + + - name: "Setup Node and npm" + uses: "actions/setup-node@v3" + with: + cache: "npm" + node-version: "${{ matrix.node_js }}" + + - name: "Install Node dependencies" + run: "npm ci" + + - name: "Run tests" + run: "npm run test"