WordPress.org

Make WordPress Core

Changeset 39478


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

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

Enforce it in the tests.

see #35105.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package.json

    r39359 r39478  
    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",
  • 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.