Skip to content

Commit

Permalink
Merge pull request #37 from Fdawgs/test/coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jun 20, 2023
2 parents 84acb74 + 72235d1 commit 7479386
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,35 @@ module.exports = {
extends: [
"airbnb-base",
"plugin:promise/recommended",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:jsdoc/recommended",
"plugin:security/recommended",
"plugin:security-node/recommended",
"prettier",
],
overrides: [
{
extends: ["plugin:jest/recommended", "plugin:jest/style"],
files: ["src/**/*.test.js"],
plugins: ["jest"],
rules: {
"jest/no-duplicate-hooks": "error",
"jest/no-test-return-statement": "error",
"jest/prefer-comparison-matcher": "error",
"jest/prefer-each": "warn",
"jest/prefer-equality-matcher": "error",
"jest/prefer-expect-resolves": "error",
"jest/prefer-hooks-in-order": "error",
"jest/prefer-hooks-on-top": "error",
"jest/prefer-mock-promise-shorthand": "error",
"jest/prefer-spy-on": "error",
"jest/require-top-level-describe": "error",
},
},
],
parserOptions: {
ecmaVersion: 2021,
},
plugins: [
"import",
"jest",
"jsdoc",
"promise",
"security",
"security-node",
],
plugins: ["import", "jsdoc", "promise", "security", "security-node"],
root: true,
rules: {
"import/no-extraneous-dependencies": "error",
Expand Down
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
"text",
"lcovonly"
],
"coverageThreshold": {
"global": {
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100
}
},
"testEnvironment": "node",
"testTimeout": 10000
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe("JSON-To-XML plugin", () => {
headers,
});

expect(JSON.parse(response.body)).toEqual(resBody);
expect(JSON.parse(response.body)).toStrictEqual(resBody);
expect(response.headers["content-type"]).toBe(
"application/json; charset=utf-8"
);
Expand Down

0 comments on commit 7479386

Please sign in to comment.