Skip to content

Commit

Permalink
chore(Tests): lint Jest tests (#3239)
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker authored Jan 18, 2024
1 parent 6433470 commit 1fcb3f2
Show file tree
Hide file tree
Showing 86 changed files with 264 additions and 594 deletions.
1 change: 0 additions & 1 deletion packages/dnb-design-system-portal/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
!/*.js
!/**/.eslintrc.js
**/tests/**/*.js
**/public/**
**/static/**
Expand Down
1 change: 0 additions & 1 deletion packages/dnb-eufemia/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
!/*.js
!/**/.eslintrc.js
**/tests/**/*.js
**/dist/**
**/build/**
Expand Down
6 changes: 6 additions & 0 deletions packages/dnb-eufemia/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"plugin:security/recommended"
],
"plugins": [
"jest",
"import",
"prettier",
"react",
Expand Down Expand Up @@ -160,6 +161,11 @@
"react/prop-types": "off",
"react/require-default-props": "off"
}
},
{
"files": ["**/__tests__/**"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"]
}
]
}
165 changes: 0 additions & 165 deletions packages/dnb-eufemia/.eslintrc.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/dnb-eufemia/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ README.md
.storybook
.eslintignore
.eslintrc
.eslintrc.json
.flowconfig
.prettierrc
.releaserc*
Expand Down
1 change: 1 addition & 0 deletions packages/dnb-eufemia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
"dotenv-cli": "4.1.0",
"eslint": "8.17.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jest": "27.6.3",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.30.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jest/no-conditional-expect */
/**
* Test for the post-build stage
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (isCI) {
global.console.error = jest.fn()
const css = loadScss(null, { data: global.core[0] })
expect(/^Error/.test(css)).toBe(false)
expect(global.console.error).toBeCalled()
expect(global.console.error).toHaveBeenCalled()
})

it('has to have correct core path to fonts', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('babelPluginIncludeDocs', () => {

expect(code).toMatchSnapshot()

expect(onComplete).toBeCalledTimes(1)
expect(onComplete).toHaveBeenCalledTimes(1)
expect(collectProps).toMatchSnapshot()
})
})
Loading

0 comments on commit 1fcb3f2

Please sign in to comment.