@centreon/js-config 25.4.2 → 25.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,79 +1,79 @@
1
1
  /* eslint-disable @typescript-eslint/no-var-requires */
2
- const { devServer } = require('cypress-rspack-dev-server');
3
- const { defineConfig } = require('cypress');
2
+ const { devServer } = require("cypress-rspack-dev-server");
3
+ const { defineConfig } = require("cypress");
4
4
  const {
5
- addMatchImageSnapshotPlugin
6
- } = require('@simonsmith/cypress-image-snapshot/plugin');
7
- const cypressCodeCoverageTask = require('@cypress/code-coverage/task');
5
+ addMatchImageSnapshotPlugin,
6
+ } = require("@simonsmith/cypress-image-snapshot/plugin");
7
+ const cypressCodeCoverageTask = require("@cypress/code-coverage/task");
8
8
 
9
9
  module.exports = ({
10
10
  rspackConfig,
11
11
  cypressFolder,
12
12
  specPattern,
13
13
  env,
14
- excludeSpecPattern
14
+ excludeSpecPattern,
15
15
  }) => {
16
- const mainCypressFolder = cypressFolder || 'cypress';
16
+ const mainCypressFolder = cypressFolder || "cypress";
17
17
 
18
18
  return defineConfig({
19
19
  component: {
20
20
  devServer: (devServerConfig) =>
21
21
  devServer({
22
22
  ...devServerConfig,
23
- framework: 'react',
24
- rspackConfig
23
+ framework: "react",
24
+ rspackConfig,
25
25
  }),
26
26
  excludeSpecPattern,
27
27
  setupNodeEvents: (on, config) => {
28
28
  addMatchImageSnapshotPlugin(on, config);
29
29
 
30
30
  cypressCodeCoverageTask(on, config);
31
- on('task', {
31
+ on("task", {
32
32
  coverageReport: () => {
33
33
  return null;
34
- }
34
+ },
35
35
  });
36
36
 
37
- on('before:browser:launch', (browser, launchOptions) => {
37
+ on("before:browser:launch", (browser, launchOptions) => {
38
38
  if (
39
- ['chromium', 'chrome'].includes(browser.name) &&
39
+ ["chrome", "chromium"].includes(browser.name) &&
40
40
  browser.isHeadless
41
41
  ) {
42
- launchOptions.args.push('--headless=new');
43
- launchOptions.args.push('--force-color-profile=srgb');
44
- launchOptions.args.push('--window-size=1400,1200');
42
+ launchOptions.args.push("--headless=new");
43
+ launchOptions.args.push("--force-color-profile=srgb");
44
+ launchOptions.args.push("--window-size=1400,1200");
45
45
  }
46
46
 
47
47
  return launchOptions;
48
48
  });
49
49
  },
50
50
  specPattern,
51
- supportFile: `${mainCypressFolder}/support/component.tsx`
51
+ supportFile: `${mainCypressFolder}/support/component.tsx`,
52
52
  },
53
53
  env: {
54
- baseUrl: 'http://localhost:9092',
54
+ baseUrl: "http://localhost:9092",
55
55
  codeCoverage: {
56
56
  exclude: [
57
- 'cypress/**/*.*',
58
- 'packages/**',
59
- 'node_modules',
60
- '**/*.js',
61
- '**/*.spec.tsx'
62
- ]
57
+ "cypress/**/*.*",
58
+ "packages/**",
59
+ "node_modules",
60
+ "**/*.js",
61
+ "**/*.spec.tsx",
62
+ ],
63
63
  },
64
- ...env
64
+ ...env,
65
65
  },
66
- reporter: 'mochawesome',
66
+ reporter: "mochawesome",
67
67
  reporterOptions: {
68
68
  html: false,
69
69
  json: true,
70
70
  overwrite: true,
71
71
  reportDir: `${mainCypressFolder}/results`,
72
- reportFilename: '[name]-report.json'
72
+ reportFilename: "[name]-report.json",
73
73
  },
74
74
  video: true,
75
75
  videosFolder: `${mainCypressFolder}/results/videos`,
76
76
  viewportHeight: 590,
77
- viewportWidth: 1280
77
+ viewportWidth: 1280,
78
78
  });
79
79
  };
@@ -280,7 +280,16 @@ Cypress.Commands.add('logout', (): void => {
280
280
 
281
281
  cy.contains(/^Logout$/).click();
282
282
 
283
- cy.wait('@logout').its('response.statusCode').should('eq', 302);
283
+ cy.waitUntil(() =>
284
+ cy.wait('@logout').then((interception) => {
285
+ return interception?.response?.statusCode === 302;
286
+ }),
287
+ {
288
+ errorMsg: 'Logout did not complete successfully',
289
+ timeout: 30000,
290
+ interval: 2000
291
+ }
292
+ );
284
293
 
285
294
  // https://github.com/cypress-io/cypress/issues/25841
286
295
  cy.clearAllCookies();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@centreon/js-config",
3
3
  "description": "Centreon Frontend shared build configuration",
4
- "version": "25.4.2",
4
+ "version": "25.5.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"