Make WordPress Core

Changeset 39480


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

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

Enforce it in the tests.

Merges [39478] to the 4.7 branch.

see #35105, #38657.

Location:
branches/4.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/package.json

    r39119 r39480  
    66    "type": "svn",
    77    "url": "https://develop.svn.wordpress.org/trunk"
     8  },
     9  "engines": {
     10    "node": "6.9.1"
    811  },
    912  "author": "The WordPress Contributors",
  • branches/4.7/tests/phpunit/tests/basic.php

    r38445 r39480  
    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.