From 46f7a6e9150519c7e1ee8c853891a01b70cb5cd7 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Feb 11 2016 08:27:40 +0000 Subject: Patch tests for newer source-map --- diff --git a/nodejs-escodegen-sourcemap.patch b/nodejs-escodegen-sourcemap.patch new file mode 100644 index 0000000..119d4ec --- /dev/null +++ b/nodejs-escodegen-sourcemap.patch @@ -0,0 +1,53 @@ +commit c7c48dd37926fbc256dfed887e48eaad1a0106f9 +Author: Tom Hughes +Date: Thu Feb 11 08:26:18 2016 +0000 + + Patch tests for newer source-map + +diff --git a/test/source-map.js b/test/source-map.js +index 4d4455e..c9bf48b 100644 +--- a/test/source-map.js ++++ b/test/source-map.js +@@ -71,7 +71,7 @@ describe('source map test', function () { + }); + + // contains mapping for identifier +- expect(result.map._mappings.some(function (mapping) { ++ expect(result.map._mappings.toArray().some(function (mapping) { + return mapping.generatedLine == 1 && + mapping.generatedColumn == 9 && + mapping.originalLine == 2 && +@@ -145,9 +145,9 @@ describe('source map test', function () { + } + + // found x param mapping +- expect(result.map._mappings.filter(isXParam).length).to.be.equal(1); ++ expect(result.map._mappings.toArray().filter(isXParam).length).to.be.equal(1); + // found y param mapping +- expect(result.map._mappings.filter(isYParam).length).to.be.equal(1); ++ expect(result.map._mappings.toArray().filter(isYParam).length).to.be.equal(1); + }); + + it('MemberExpression test', function () { +@@ -215,10 +215,10 @@ describe('source map test', function () { + } + + // found object mapping +- expect(result.map._mappings.filter(isObject).length).to.be.equal(1); ++ expect(result.map._mappings.toArray().filter(isObject).length).to.be.equal(1); + + // found one property mapping +- expect(result.map._mappings.filter(isProperty).length).to.be.equal(1); ++ expect(result.map._mappings.toArray().filter(isProperty).length).to.be.equal(1); + }); + + it('Declaration in Function test', function () { +@@ -300,7 +300,7 @@ describe('source map test', function () { + }); + + // "found a declaration node" +- expect(result.map._mappings.filter(function (x) { ++ expect(result.map._mappings.toArray().filter(function (x) { + return x.originalLine == 1 && x.originalColumn == 6; + }).length).to.be.equal(1); + }); diff --git a/nodejs-escodegen.spec b/nodejs-escodegen.spec index e9c5e1c..0b5e537 100644 --- a/nodejs-escodegen.spec +++ b/nodejs-escodegen.spec @@ -4,7 +4,7 @@ Name: nodejs-escodegen Version: 1.3.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: ECMAScript code generator License: BSD Group: System Environment/Libraries @@ -14,6 +14,8 @@ Source0: https://registry.npmjs.org/escodegen/-/escodegen-%{version}.tgz # revision control repository. Source1: tests-%{version}.tar.bz2 Source10: dl-tests.sh +# Patch tests for newer source-map +Patch0: nodejs-escodegen-sourcemap.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch @@ -36,6 +38,7 @@ BuildRequires: npm(source-map) %prep %setup -q -n package %setup -q -T -D -a 1 -n package +%patch0 -p1 %nodejs_fixdep esprima "^2.7.1" %nodejs_fixdep source-map "^0.5.2" rm -f *.min.js @@ -83,6 +86,9 @@ rm test/moz.js # needs esprima-moz %changelog +* Thu Feb 11 2016 Tom Hughes - 1.3.2-8 +- Patch tests for newer source-map + * Wed Feb 10 2016 Tom Hughes - 1.3.2-7 - Update npm(source-map) dependency