@centreon/js-config 23.10.27 → 23.10.29

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.
@@ -225,29 +225,7 @@ interface StartContainerProps {
225
225
  Cypress.Commands.add(
226
226
  'startContainer',
227
227
  ({ name, image, portBindings }: StartContainerProps): Cypress.Chainable => {
228
- return cy
229
- .exec('docker image list --format "{{.Repository}}:{{.Tag}}"')
230
- .then(({ stdout }) => {
231
- if (
232
- stdout.match(
233
- new RegExp(
234
- `^${image.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}`,
235
- 'm'
236
- )
237
- )
238
- ) {
239
- cy.log(`Local docker image found : ${image}`);
240
-
241
- return cy.wrap(image);
242
- }
243
-
244
- cy.log(`Pulling remote docker image : ${image}`);
245
-
246
- return cy.exec(`docker pull ${image}`).then(() => cy.wrap(image));
247
- })
248
- .then((imageName) =>
249
- cy.task('startContainer', { image: imageName, name, portBindings })
250
- );
228
+ return cy.task('startContainer', { image, name, portBindings });
251
229
  }
252
230
  );
253
231
 
@@ -3,6 +3,8 @@
3
3
  /* eslint-disable @typescript-eslint/no-var-requires */
4
4
  /* eslint-disable no-param-reassign */
5
5
 
6
+ import { execSync } from 'child_process';
7
+
6
8
  import Docker from 'dockerode';
7
9
  import { addCucumberPreprocessorPlugin } from '@badeball/cypress-cucumber-preprocessor';
8
10
  import webpackPreprocessor from '@cypress/webpack-preprocessor';
@@ -91,6 +93,21 @@ export default async (on, config): Promise<void> => {
91
93
  name,
92
94
  portBindings = []
93
95
  }: StartContainerProps) => {
96
+ const imageList = execSync(
97
+ 'docker image list --format "{{.Repository}}:{{.Tag}}"'
98
+ ).toString('utf8');
99
+
100
+ if (
101
+ !imageList.match(
102
+ new RegExp(
103
+ `^${image.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')}`,
104
+ 'm'
105
+ )
106
+ )
107
+ ) {
108
+ execSync(`docker pull ${image}`);
109
+ }
110
+
94
111
  const webContainers = await docker.listContainers({
95
112
  all: true,
96
113
  filters: { name: [name] }
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": "23.10.27",
4
+ "version": "23.10.29",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "downlevelIteration": true,
4
4
  "module": "ESNext",
5
+ "moduleResolution": "node",
5
6
  "target": "es2018",
6
7
  "jsx": "react-jsx",
7
8
  "strict": true,