Skip to content

Commit

Permalink
update all dev deps and use latest eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
paed01 committed Apr 11, 2024
1 parent 7436ade commit 7c7f83c
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 44 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.json

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/build-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 18, 20, latest]
node-version: [18, 20, latest]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run test:lcov
- name: Coveralls
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.node-version }}
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
18
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# unreleased

- update all dev dependencies and run tests

# 7.1.0

- add process attribute `historyTimeToLive` to process environment variables when running
Expand Down
1 change: 0 additions & 1 deletion babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* global module */
module.exports = function babelRoot(api) {
api.cache(true);

Expand Down
106 changes: 106 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import js from '@eslint/js';
import globals from 'globals';

const rules = {
'dot-notation': [2, { allowKeywords: true }],
'eol-last': 2,
eqeqeq: 2,
'linebreak-style': ['error', 'unix'],
'no-alert': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-catch-shadow': 2,
'no-console': 1,
'no-eval': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-fallthrough': 'off',
'no-implied-eval': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': 2,
'no-lone-blocks': 2,
'no-loop-func': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0, maxBOF: 0 }],
'no-new-func': 2,
'no-new-object': 2,
'no-new-wrappers': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-process-exit': 2,
'no-proto': 2,
'no-prototype-builtins': 2,
'no-return-assign': 2,
'no-script-url': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-shadow': 2,
'no-spaced-func': 2,
'no-trailing-spaces': 2,
'no-undef-init': 2,
'no-undef': 2,
'no-underscore-dangle': 0,
'no-unused-expressions': 2,
'no-use-before-define': 0,
'no-var': 0,
'no-with': 2,
'prefer-const': ['error', { destructuring: 'all' }],
'require-atomic-updates': 0,
'require-await': 2,
'semi-spacing': [2, { before: false, after: true }],
semi: [2, 'always'],
'space-before-blocks': 2,
'space-before-function-paren': [2, { anonymous: 'never', named: 'never' }],
'space-infix-ops': 2,
'space-unary-ops': [2, { words: true, nonwords: false }],
'unicode-bom': ['error', 'never'],
yoda: [2, 'never'],
};

export default [
js.configs.recommended,
{
rules,
},
{
files: ['**/*.js'],
languageOptions: {
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
globals: {
...globals['shared-node-browser'],
...globals.es6,
},
},
},
{
files: ['test/**/*.js'],
languageOptions: {
globals: {
...globals.node,
...globals.mocha,
expect: 'readonly',
beforeEachScenario: 'readonly',
Buffer: 'readonly',
Feature: 'readonly',
Scenario: 'readonly',
Given: 'readonly',
When: 'readonly',
Then: 'readonly',
And: 'readonly',
But: 'readonly',
},
},
rules: {
'no-unused-expressions': 0,
'no-var': 1,
},
},
{
ignores: ['coverage/**/*', 'node_modules/**/*', 'tmp/*', 'dist/*'],
},
];
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,20 @@
"license": "MIT",
"devDependencies": {
"@aircall/expression-parser": "^1.0.4",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/preset-env": "^7.23.8",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@babel/register": "^7.23.7",
"bpmn-elements-8-1": "npm:bpmn-elements@8.1",
"bpmn-engine": "^18.0.0",
"bpmn-engine": "^20.0.1",
"bpmn-engine-14": "npm:bpmn-engine@14",
"bpmn-moddle": "^8.1.0",
"bpmn-moddle": "^9.0.1",
"c8": "^9.1.0",
"camunda-bpmn-moddle": "^7.0.1",
"chai": "^5.0.0",
"chai": "^5.0.3",
"chronokinesis": "^6.0.0",
"debug": "^4.3.4",
"eslint": "^8.56.0",
"eslint-plugin-import": "^2.29.1",
"eslint": "^9.0.0",
"mocha": "^10.2.0",
"mocha-cakes-2": "^3.3.0",
"moddle-context-serializer": "^4.1.1",
Expand Down
44 changes: 43 additions & 1 deletion test/features/error-feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,51 @@ Feature('Flow errors', () => {
flow.run();
});

And('task is fails', async () => {
And('task fails', async () => {
const err = await error;
expect(err.content.error).to.match(/SyntaxError/);
});

Given('a flow with a output expression succeeded by a faulty task', async () => {
const source = `<?xml version="1.0" encoding="UTF-8"?>
<definitions id="command-definition" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" targetNamespace="http://bpmn.io/schema/bpmn">
<process id="my-process" isExecutable="true" candidateStarterGroups="admin">
<task id="task">
<extensionElements>
<camunda:inputOutput>
<camunda:outputParameter name="foo">bar</camunda:outputParameter>
</camunda:inputOutput>
</extensionElements>
</task>
<sequenceFlow id="to-fail" sourceRef="task" targetRef="epic-fail" />
<task id="epic-fail">
<extensionElements>
<camunda:inputOutput>
<camunda:outputParameter name="baz">\${content.output.result)}</camunda:outputParameter>
</camunda:inputOutput>
</extensionElements>
</task>
</process>
</definitions>`;

flow = await testHelpers.getOnifyFlow(source);
});

When('started', () => {
error = flow.waitFor('error');
flow.run();
});

And('task fails', async () => {
const err = await error;
expect(err.content.error).to.match(/SyntaxError/);
});

And('flow has output from non-failing task', async () => {
expect(await flow.getState())
.to.have.property('environment')
.with.property('output')
.with.property('foo', 'bar');
});
});
});

0 comments on commit 7c7f83c

Please sign in to comment.