Make WordPress Core


Ignore:
Timestamp:
12/04/2016 05:29:26 PM (8 years ago)
Author:
nacin
Message:

Build/Test Tools: Specify exact node version in package.json.

Enforce it in the tests.

see #35105.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/basic.php

    r38445 r39478  
    2424        }
    2525        $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
     26        return $package_json;
    2627    }
     28
     29    /**
     30     * @depends test_package_json
     31     */
     32    function test_package_json_node_engine( $package_json ) {
     33        $this->assertArrayHasKey( 'engines', $package_json );
     34        $this->assertArrayHasKey( 'node', $package_json['engines'] );
     35        $node = $package_json['engines']['node'];
     36        $this->assertRegExp( '~^=?\d+\.\d+\.\d+$~', $node, "package.json's node version cannot be a range." );
     37    }
    2738
    2839    // two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
Note: See TracChangeset for help on using the changeset viewer.