Skip to content

Commit

Permalink
Tech – Migre le Frontend vers l'ESM (#3523)
Browse files Browse the repository at this point in the history
## Linked issues

None

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
ivangabriele authored Aug 29, 2024
2 parents fdd0a5b + a4a8d7c commit 5f0adb3
Show file tree
Hide file tree
Showing 16 changed files with 4,060 additions and 2,035 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
- uses: cypress-io/github-action@v6
with:
browser: firefox
config-file: config/cypress.config.js
config-file: config/cypress.config.ts
env: PORT=8880
install: true
install-command: npm ci
Expand Down
9 changes: 7 additions & 2 deletions frontend/.eslintrc.js → frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
ecmaVersion: 2022,
project: path.join(__dirname, 'tsconfig.json')
},
ignorePatterns: ['.eslintrc.js', '.eslintrc.partial.js', 'config/cypress.config.js'],
ignorePatterns: ['.eslintrc.cjs', '.eslintrc.partial.cjs'],
env: {
browser: true
},
Expand Down Expand Up @@ -200,12 +200,17 @@ module.exports = {
'./scripts/**/*.js',
'**/*.spec.ts',
'./config/**/*.ts',
'./scripts/**/*.mjs',
'./scripts/**/*.ts'
],
env: {
browser: false,
node: true
},
rules: {
'import/no-default-export': 'off',
'import/no-extraneous-dependencies': 'off',

'@typescript-eslint/naming-convention': 'off'
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
extends: './.eslintrc.js',
extends: './.eslintrc.cjs',
ignorePatterns: ['**/*.js', '**/*.jsx']
}
3 changes: 1 addition & 2 deletions frontend/config/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
// eslint-disable-next-line @typescript-eslint/naming-convention
export default {
__esModule: true,
default: 'test-file-stub'
}
43 changes: 0 additions & 43 deletions frontend/config/cypress.config.js

This file was deleted.

5 changes: 2 additions & 3 deletions frontend/config/fileTransformer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const path = require('path')
import path from 'path'

// https://jestjs.io/docs/code-transformation#examples

module.exports = {
export default {
process(sourceText, sourcePath) {
return {
code: `module.exports = ${JSON.stringify(path.basename(sourcePath))};`
Expand Down
2 changes: 1 addition & 1 deletion frontend/config/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
clearMocks: true,
collectCoverageFrom: ['**/{hooks,libs,utils}/**/*.t{s,sx}', '**/utils.ts'],
globalSetup: '<rootDir>/config/jest.global.js',
Expand Down
2 changes: 1 addition & 1 deletion frontend/config/jest.global.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @see https://jestjs.io/docs/configuration#globalsetup-string
*/
module.exports = () => {
export default () => {
process.env.TZ = 'America/New_York'
}
2 changes: 1 addition & 1 deletion frontend/config/multi-windows/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
export default {
globalSetup: '<rootDir>/puppeteer/setup.ts',
// because it's detected by the default value of testRegex
// https://jestjs.io/docs/configuration#testregex-string--arraystring
Expand Down
Loading

0 comments on commit 5f0adb3

Please sign in to comment.