@wordpress/env 10.1.0 → 10.3.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.
|
@@ -417,6 +417,11 @@ async function parseEnvironmentConfig(
|
|
|
417
417
|
continue;
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
+
// The $schema key is a special key that is used to validate the configuration.
|
|
421
|
+
if ( key === '$schema' ) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
|
|
420
425
|
// We should also check root-only options for the root config
|
|
421
426
|
// because these aren't part of the above defaults but are
|
|
422
427
|
// configuration options that we will parse.
|
|
@@ -254,6 +254,26 @@ describe( 'parseConfig', () => {
|
|
|
254
254
|
} );
|
|
255
255
|
} );
|
|
256
256
|
|
|
257
|
+
it( 'should ignore `$schema` key', async () => {
|
|
258
|
+
readRawConfigFile.mockImplementation( async ( configFile ) => {
|
|
259
|
+
if ( configFile === '/test/gutenberg/.wp-env.json' ) {
|
|
260
|
+
return {
|
|
261
|
+
$schema: 'test',
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if ( configFile === '/test/gutenberg/.wp-env.override.json' ) {
|
|
266
|
+
return {};
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
throw new Error( 'Invalid File: ' + configFile );
|
|
270
|
+
} );
|
|
271
|
+
|
|
272
|
+
const parsed = await parseConfig( '/test/gutenberg', '/cache' );
|
|
273
|
+
|
|
274
|
+
expect( parsed ).toEqual( DEFAULT_CONFIG );
|
|
275
|
+
} );
|
|
276
|
+
|
|
257
277
|
it( 'should override with environment variables', async () => {
|
|
258
278
|
process.env.WP_ENV_PORT = 123;
|
|
259
279
|
process.env.WP_ENV_TESTS_PORT = 456;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/env",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.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",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"scripts": {
|
|
56
56
|
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "122867d355ca4edc63d3a3bbd9411d3a2e1458df"
|
|
59
59
|
}
|