From 133ea3df091e01347ee74086bde7c091caf7a929 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Wed, 11 Sep 2013 18:40:27 -0400 Subject: [PATCH] Use a regular expression to parse out React.version. This fixes a silent failure of the test suite that appears to be due to the call require('./build/modules/React'). --- Gruntfile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index d01fcbdc3a..6d9ce5bb3b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -55,8 +55,11 @@ module.exports = function(grunt) { // Check that the version we're exporting is the same one we expect in the // package. This is not an ideal way to do this, but makes sure that we keep // them in sync. + var reactVersionExp = /\bReact\.version\s*=\s*['"]([^'"]+)['"];/; grunt.registerTask('version-check', function() { - var version = require('./build/modules/React').version; + var version = reactVersionExp.exec( + grunt.file.read('./build/modules/React.js') + )[1]; var expectedVersion = grunt.config.data.pkg.version; if (version !== expectedVersion) { grunt.log.error('Versions do not match. Expected %s, saw %s', expectedVersion, version);