From b2e2ba5423b7a68121f41558f576ef658ce55665 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Dec 23 2016 15:08:59 +0000 Subject: Add patch for test failures with Node 6.9 --- diff --git a/nodejs-millstone-json.patch b/nodejs-millstone-json.patch new file mode 100644 index 0000000..e150522 --- /dev/null +++ b/nodejs-millstone-json.patch @@ -0,0 +1,34 @@ +commit 14ed45c8a803a193d527bc8d6fed70f5ca6d6cbc +Author: Tom Hughes +Date: Fri Dec 23 15:01:58 2016 +0000 + + Fix invalid json test for changes in Node.js + + In recent versions of Node.js the error message is now: + + SyntaxError: Unexpected token ] in JSON at position 190 + + instead of: + + SyntaxError: Unexpected token ] + +diff --git a/test/error.test.js b/test/error.test.js +index 8fba15f..531bc69 100644 +--- a/test/error.test.js ++++ b/test/error.test.js +@@ -25,7 +25,7 @@ it('correctly handles invalid json', function(done) { + }; + + millstone.resolve(options, function(err, resolved) { +- assert.ok(err.message.search("error: 'Unexpected token ]'") != -1); ++ assert.ok(err.message.search("error: 'Unexpected token \\][' ]") != -1); + done(); + }); + }); +@@ -61,4 +61,4 @@ it('correctly handles missing shapefile at absolute path', function(done) { + assert.ok(err_expected); + done(); + }); +-}); +\ No newline at end of file ++}); diff --git a/nodejs-millstone.spec b/nodejs-millstone.spec index a2eb92e..8607b6f 100644 --- a/nodejs-millstone.spec +++ b/nodejs-millstone.spec @@ -2,14 +2,16 @@ Name: nodejs-millstone Version: 0.6.17 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Prepares data sources in an MML file for consumption in Mapnik License: BSD -URL: https://github.com/mapbox/millstone +URL: https://github.com/tilemill-project/millstone Source0: https://registry.npmjs.org/millstone/-/millstone-%{version}.tgz # Remove tests that need internet access Patch0: nodejs-millstone-internet.patch +# https://github.com/tilemill-project/millstone/pull/129 +Patch1: nodejs-millstone-json.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch @@ -39,6 +41,7 @@ flush can be used to clear the cache of a specific resource. %if ! %{with internet} %patch0 -p1 %endif +%patch1 -p1 %nodejs_fixdep generic-pool "^2.0.3" %nodejs_fixdep sqlite3 ">= 2 < 4" %nodejs_fixdep underscore "^1.6.0" @@ -66,6 +69,9 @@ cp -pr package.json bin lib %{buildroot}/%{nodejs_sitelib}/millstone %changelog +* Fri Dec 23 2016 Tom Hughes - 0.6.17-3 +- Add patch for test failures with Node 6.9 + * Mon Mar 7 2016 Tom Hughes - 0.6.17-2 - Fix npm(underscore) dependency