From d8f2e8f17e0b73aeb36e18065fa2b835ff783bf1 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Wed, 21 Feb 2024 07:36:51 +0000 Subject: [PATCH 1/2] deps: tap@~0.7.0->~5.4.5 5.4.5 is actually last version to work on node 0.8 --- package.json | 2 +- test/inline-source-map.js | 25 ++++++++++++++----------- test/source-content.js | 13 +++++++------ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 3beaf82..62664b8 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "source-map": "~0.5.3" }, "devDependencies": { - "tap": "~0.7.0", + "tap": "~5.4.5", "nave": "~0.5.0" }, "keywords": [ diff --git a/test/inline-source-map.js b/test/inline-source-map.js index df64004..8bff7f6 100644 --- a/test/inline-source-map.js +++ b/test/inline-source-map.js @@ -31,7 +31,7 @@ test('generated mappings', function (t) { var gen = generator() .addGeneratedMappings('foo.js', foo) - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 1, generatedColumn: 0, @@ -66,7 +66,7 @@ test('generated mappings', function (t) { , 'generates correct mappings' ) - t.deepEqual( + t.same( JSON.parse(decode(gen.base64Encode())) , {"version":3,"file":"","sources":["foo.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA","sourceRoot":""} , 'encodes generated mappings' @@ -84,7 +84,7 @@ test('generated mappings', function (t) { .addGeneratedMappings('foo.js', foo) .addGeneratedMappings('bar.js', bar) - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 1, generatedColumn: 0, @@ -136,7 +136,7 @@ test('generated mappings', function (t) { name: null } ] , 'generates correct mappings' ) - t.deepEqual( + t.same( JSON.parse(decode(gen.base64Encode())) , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","sourceRoot": ""} , 'encodes generated mappings' @@ -151,7 +151,7 @@ test('generated mappings', function (t) { t.test('one line source', function (t) { var gen = generator().addGeneratedMappings('one-liner.js', 'console.log("line one");') - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 1, generatedColumn: 0, @@ -169,7 +169,7 @@ test('generated mappings', function (t) { .addGeneratedMappings('foo.js', foo, { line: 20 }) .addGeneratedMappings('bar.js', bar, { line: 23, column: 22 }) - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 21, generatedColumn: 0, @@ -222,13 +222,14 @@ test('generated mappings', function (t) { , 'generates correct mappings' ) - t.deepEqual( + t.same( JSON.parse(decode(gen.base64Encode())) , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA,sBCHA;ADIA,sBCHA;sBACA", "sourceRoot": ""} , 'encodes generated mappings with offset' ) t.end() }) + t.end() }) test('given mappings, with one having no original', function (t) { @@ -246,7 +247,7 @@ test('given mappings, with one having no original', function (t) { , { generated: { line: 8, column: 30 } } ]) - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 5, generatedColumn: 10, @@ -268,7 +269,7 @@ test('given mappings, with one having no original', function (t) { name: null } ] , 'adds correct mappings' ) - t.deepEqual( + t.same( JSON.parse(decode(gen.base64Encode())) , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;UACG;;oBCIH;8B", sourceRoot: ""} , 'encodes generated mappings' @@ -286,7 +287,7 @@ test('given mappings, with one having no original', function (t) { .addMappings('foo.js', [{ original: { line: 2, column: 3 } , generated: { line: 5, column: 10 } }], { line: 5 }) .addMappings('bar.js', [{ original: { line: 6, column: 0 } , generated: { line: 7, column: 20 } }, { generated: { line: 8, column: 30 } }], { line: 9, column: 3 }) - t.deepEqual( + t.same( gen._mappings() , [ { generatedLine: 10, generatedColumn: 10, @@ -308,13 +309,14 @@ test('given mappings, with one having no original', function (t) { name: null } ] , 'adds correct mappings' ) - t.deepEqual( + t.same( JSON.parse(decode(gen.base64Encode())) , {"version":3,"file":"","sources":["foo.js","bar.js"],"names":[],"mappings":";;;;;;;;;UACG;;;;;;uBCIH;iC", sourceRoot: ""} , 'encodes mappings with offset' ) t.end() }) + t.end() }); test('inline mapping url with charset opt', function(t){ @@ -342,4 +344,5 @@ test('inline mapping url with charset opt', function(t){ t.end(); }); + t.end() }); diff --git a/test/source-content.js b/test/source-content.js index c44cd3c..3db1651 100644 --- a/test/source-content.js +++ b/test/source-content.js @@ -32,7 +32,7 @@ test('generated mappings', function (t) { .addGeneratedMappings('foo.js', foo) .addSourceContent('foo.js', foo) - t.deepEqual( + t.same( gen.toJSON() , { "version": 3, "file": "", @@ -69,7 +69,7 @@ test('generated mappings', function (t) { .addGeneratedMappings('bar.js', bar) .addSourceContent('bar.js', bar) - t.deepEqual( + t.same( gen.toJSON() , { "version": 3, "file": "", @@ -88,7 +88,7 @@ test('generated mappings', function (t) { , 'includes source content for both files' ) - t.deepEqual( + t.same( decode(gen.base64Encode()) , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":["function foo() {\\n var hello = \'hello\';\\n var world = \'world\';\\n console.log(\'%s %s\', hello, world);\\n}","function bar() {\\n console.log(\'yes?\');\\n}"]}' , 'encodes generated mappings including source content' @@ -107,7 +107,7 @@ test('generated mappings', function (t) { .addGeneratedMappings('bar.js', bar) .addSourceContent('bar.js', bar) - t.deepEqual( + t.same( gen.toJSON() , { "version": 3, "file": "", @@ -123,7 +123,7 @@ test('generated mappings', function (t) { , 'includes source content for the file with source content and [null] for the other file' ) - t.deepEqual( + t.same( decode(gen.base64Encode()) , '{"version":3,"sources":["foo.js","bar.js"],"names":[],"mappings":"ACAA,ADAA;ACCA,ADAA;ACCA,ADAA;AACA;AACA","file":"","sourceRoot":"","sourcesContent":[null,"function bar() {\\n console.log(\'yes?\');\\n}"]}' , 'encodes generated mappings including source content' @@ -140,7 +140,8 @@ test('generated mappings', function (t) { var gen = generator() .addGeneratedMappings('empty.js', '') .addSourceContent('empty.js', '') - t.deepEqual(gen.toJSON()["sourcesContent"], [""]) + t.same(gen.toJSON()["sourcesContent"], [""]) t.end() }); + t.end() }) From 7eadcabff4c401bfbd56d291cc90c46e2e2450df Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Wed, 21 Feb 2024 07:38:46 +0000 Subject: [PATCH 2/2] devDeps: nave@~0.5.0->^3.5.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 62664b8..167941c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "devDependencies": { "tap": "~5.4.5", - "nave": "~0.5.0" + "nave": "^3.5.2" }, "keywords": [ "source",