Build/Test Tools: Specify exact node version in package.json.
Enforce it in the tests. see #35105. git-svn-id: https://develop.svn.wordpress.org/trunk@39478 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
06ee519376
commit
b16f57240e
@ -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": {
|
||||
|
@ -23,6 +23,17 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user