diff --git a/.github/workflows/semantic-release.yaml b/.github/workflows/semantic-release.yaml index 83ff58d..ec3d470 100644 --- a/.github/workflows/semantic-release.yaml +++ b/.github/workflows/semantic-release.yaml @@ -19,6 +19,7 @@ jobs: cache: npm node-version: 16 - run: npm ci + - run: npm test - run: npm run build - run: zip -r dist.zip dist - run: npx semantic-release diff --git a/test/index.js b/test/index.js index 2ad800a..958aa8f 100644 --- a/test/index.js +++ b/test/index.js @@ -386,4 +386,17 @@ describe('Ading Token', function () { ]) assert.equal(Mexp.eval('maxof5(7, 12, 23, 33, 2)'), 33) }) + it('token with absolute', function () { + Mexp.addToken([ + { + type: 0, + token: 'positive', + show: 'positive', + value: function (a) { + return Math.abs(a) + }, + }, + ]) + assert.equal(Mexp.eval('root(positive(2-6))'), 2) + }) })