@wordpress/env 9.9.0 → 10.0.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.
|
@@ -108,7 +108,7 @@ const DEFAULT_ENVIRONMENT_CONFIG = {
|
|
|
108
108
|
* @param {string} configDirectoryPath A path to the directory we are parsing the config for.
|
|
109
109
|
* @param {string} cacheDirectoryPath Path to the work directory located in ~/.wp-env.
|
|
110
110
|
*
|
|
111
|
-
* @return {WPRootConfig} Parsed config.
|
|
111
|
+
* @return {Promise<WPRootConfig>} Parsed config.
|
|
112
112
|
*/
|
|
113
113
|
async function parseConfig( configDirectoryPath, cacheDirectoryPath ) {
|
|
114
114
|
// The local config will be used to override any defaults.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
/* eslint-disable jest/no-conditional-expect */
|
|
3
2
|
/**
|
|
4
3
|
* Internal dependencies
|
|
5
4
|
*/
|
|
@@ -319,16 +318,13 @@ describe( 'parseConfig', () => {
|
|
|
319
318
|
it( 'throws when latest WordPress version needed but not found', async () => {
|
|
320
319
|
getLatestWordPressVersion.mockResolvedValue( null );
|
|
321
320
|
|
|
322
|
-
expect
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
)
|
|
330
|
-
);
|
|
331
|
-
}
|
|
321
|
+
await expect(
|
|
322
|
+
parseConfig( '/test/gutenberg', '/cache' )
|
|
323
|
+
).rejects.toEqual(
|
|
324
|
+
new ValidationError(
|
|
325
|
+
'Could not find the latest WordPress version. There may be a network issue.'
|
|
326
|
+
)
|
|
327
|
+
);
|
|
332
328
|
} );
|
|
333
329
|
|
|
334
330
|
it( 'throws for unknown config options', async () => {
|
|
@@ -346,16 +342,13 @@ describe( 'parseConfig', () => {
|
|
|
346
342
|
throw new Error( 'Invalid File: ' + configFile );
|
|
347
343
|
} );
|
|
348
344
|
|
|
349
|
-
expect
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
)
|
|
357
|
-
);
|
|
358
|
-
}
|
|
345
|
+
await expect(
|
|
346
|
+
parseConfig( '/test/gutenberg', '/cache' )
|
|
347
|
+
).rejects.toEqual(
|
|
348
|
+
new ValidationError(
|
|
349
|
+
`Invalid /test/gutenberg/.wp-env.json: "test" is not a configuration option.`
|
|
350
|
+
)
|
|
351
|
+
);
|
|
359
352
|
} );
|
|
360
353
|
|
|
361
354
|
it( 'throws for root-only config options', async () => {
|
|
@@ -378,16 +371,12 @@ describe( 'parseConfig', () => {
|
|
|
378
371
|
throw new Error( 'Invalid File: ' + configFile );
|
|
379
372
|
} );
|
|
380
373
|
|
|
381
|
-
expect
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
)
|
|
389
|
-
);
|
|
390
|
-
}
|
|
374
|
+
await expect(
|
|
375
|
+
parseConfig( '/test/gutenberg', '/cache' )
|
|
376
|
+
).rejects.toEqual(
|
|
377
|
+
new ValidationError(
|
|
378
|
+
`Invalid /test/gutenberg/.wp-env.json: "development.env" is not a configuration option.`
|
|
379
|
+
)
|
|
380
|
+
);
|
|
391
381
|
} );
|
|
392
382
|
} );
|
|
393
|
-
/* eslint-enable jest/no-conditional-expect */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/env",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "A zero-config, self contained local WordPress environment for development and testing.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"bugs": {
|
|
20
20
|
"url": "https://github.com/WordPress/gutenberg/issues"
|
|
21
21
|
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=18.12.0",
|
|
24
|
+
"npm": ">=8.19.2"
|
|
25
|
+
},
|
|
22
26
|
"directories": {
|
|
23
27
|
"lib": "lib",
|
|
24
28
|
"test": "tests"
|
|
@@ -51,5 +55,5 @@
|
|
|
51
55
|
"scripts": {
|
|
52
56
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
53
57
|
},
|
|
54
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2f30cddff15723ac7017fd009fc5913b7b419400"
|
|
55
59
|
}
|