From 0c11cef5637476df5f720e10e19850c5ec95aa13 Mon Sep 17 00:00:00 2001 From: Thomas Parisot Date: Sun, 3 Feb 2019 17:10:17 +0100 Subject: [PATCH] Remove deprecated crx.writeFile() --- src/crx.js | 23 ----------------------- test/index.js | 4 +--- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/crx.js b/src/crx.js index 98774e3..8d04ac9 100644 --- a/src/crx.js +++ b/src/crx.js @@ -1,6 +1,5 @@ "use strict"; -var fs = require("fs"); var path = require("path"); var join = path.join; var crypto = require("crypto"); @@ -84,28 +83,6 @@ class ChromeExtension { }); } - /** - * Writes data into the extension workable directory. - * - * @deprecated - * @param {string} path - * @param {*} data - * @returns {Promise} - */ - writeFile (path, data) { - var absPath = join(this.path, path); - - /* istanbul ignore next */ - return new Promise(function(resolve, reject) { - fs.writeFile(absPath, data, function(err) { - if (err) { - return reject(err); - } - - resolve(); - }); - }); - } /** * Generates a public key. diff --git a/test/index.js b/test/index.js index 40a073b..d3cd072 100644 --- a/test/index.js +++ b/test/index.js @@ -69,9 +69,7 @@ test('#writeFile', function(t){ var crx = newCrx(); - crx.writeFile('/tmp/crx', new Error('')).catch(function(err){ - t.ok(err); - }); + t.throws(() => crx.writeFile('/tmp/crx')); }); test('#loadContents', function(t){