@wordpress/env 10.0.1 → 10.0.2

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.
@@ -407,6 +407,11 @@ async function parseEnvironmentConfig(
407
407
  continue;
408
408
  }
409
409
 
410
+ // The $schema key is a special key that is used to validate the configuration.
411
+ if ( key === '$schema' ) {
412
+ continue;
413
+ }
414
+
410
415
  // We should also check root-only options for the root config
411
416
  // because these aren't part of the above defaults but are
412
417
  // configuration options that we will parse.
@@ -253,6 +253,26 @@ describe( 'parseConfig', () => {
253
253
  } );
254
254
  } );
255
255
 
256
+ it( 'should ignore `$schema` key', async () => {
257
+ readRawConfigFile.mockImplementation( async ( configFile ) => {
258
+ if ( configFile === '/test/gutenberg/.wp-env.json' ) {
259
+ return {
260
+ $schema: 'test',
261
+ };
262
+ }
263
+
264
+ if ( configFile === '/test/gutenberg/.wp-env.override.json' ) {
265
+ return {};
266
+ }
267
+
268
+ throw new Error( 'Invalid File: ' + configFile );
269
+ } );
270
+
271
+ const parsed = await parseConfig( '/test/gutenberg', '/cache' );
272
+
273
+ expect( parsed ).toEqual( DEFAULT_CONFIG );
274
+ } );
275
+
256
276
  it( 'should override with environment variables', async () => {
257
277
  process.env.WP_ENV_PORT = 123;
258
278
  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.0.1",
3
+ "version": "10.0.2",
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": "0e973525f7787401b5a544e0727774d52a78639f"
58
+ "gitHead": "9dd5f8dcfa4fc7242e5d48be20ee789ad087b432"
59
59
  }