Skip to content

Commit

Permalink
fix(KUI-1369): jest-extended has been added to the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhossein-haerian committed Jun 25, 2024
1 parent 1d914ea commit 3e82f9f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
setupFilesAfterEnv: ['jest-extended/all'],
testEnvironment: 'jsdom',
}
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-extended": "^4.0.2",
"lint-staged": "^15.2.5",
"mini-css-extract-plugin": "^2.9.0",
"node-mocks-http": "^1.14.1",
Expand Down
6 changes: 3 additions & 3 deletions server/utils/noIndexMiddleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('noIndexMiddleware', () => {
noIndexMiddleware(req, res, next)

expect(res.getHeader('X-Robots-Tag')).toBeUndefined()
expect(next).toHaveBeenCalledTimes(1)
expect(next).toHaveBeenCalledOnce()
})

it('should not set "X-Robots-Tag" header if "X-Forwarded-Host" match SERVER_HOST_URL', () => {
Expand All @@ -31,7 +31,7 @@ describe('noIndexMiddleware', () => {
noIndexMiddleware(req, res, next)

expect(res.getHeader('X-Robots-Tag')).toBeUndefined()
expect(next).toHaveBeenCalledTimes(1)
expect(next).toHaveBeenCalledOnce()
})

it('should set "X-Robots-Tag" header if "X-Forwarded-Host" does not match SERVER_HOST_URL', () => {
Expand All @@ -45,6 +45,6 @@ describe('noIndexMiddleware', () => {
noIndexMiddleware(req, res, next)

expect(res.getHeader('X-Robots-Tag')).toBe('noindex')
expect(next).toHaveBeenCalledTimes(1)
expect(next).toHaveBeenCalledOnce()
})
})

0 comments on commit 3e82f9f

Please sign in to comment.