diff --git a/package.json b/package.json index 6ed02b43c0..da4f032b58 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,9 @@ "type": "svn", "url": "https://develop.svn.wordpress.org/trunk" }, + "engines": { + "node": "6.9.1" + }, "author": "The WordPress Contributors", "license": "GPL-2.0+", "devDependencies": { diff --git a/tests/phpunit/tests/basic.php b/tests/phpunit/tests/basic.php index a17f94e7cc..2795824361 100644 --- a/tests/phpunit/tests/basic.php +++ b/tests/phpunit/tests/basic.php @@ -23,8 +23,19 @@ class Tests_Basic extends WP_UnitTestCase { $version .= '.0'; } $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." ); + return $package_json; } + /** + * @depends test_package_json + */ + function test_package_json_node_engine( $package_json ) { + $this->assertArrayHasKey( 'engines', $package_json ); + $this->assertArrayHasKey( 'node', $package_json['engines'] ); + $node = $package_json['engines']['node']; + $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." ); + } + // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference function test_globals() { global $test_foo;