Skip to content

Commit

Permalink
Merge pull request #817 from willrowe/feature/project-managment/actio…
Browse files Browse the repository at this point in the history
…ns/add-test

Add GitHub actions test workflow
  • Loading branch information
willrowe authored Jun 27, 2022
2 parents 35a95f3 + ef0317c commit e196010
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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"
1 change: 1 addition & 0 deletions src/twig.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down

0 comments on commit e196010

Please sign in to comment.