mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-07 22:24:36 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user