From fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 14 Oct 2023 15:58:02 +0800 Subject: added plugin from postcss: postcss-fixes rucksack-css --- node_modules/write-file-stdout/test/index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 node_modules/write-file-stdout/test/index.js (limited to 'node_modules/write-file-stdout/test') diff --git a/node_modules/write-file-stdout/test/index.js b/node_modules/write-file-stdout/test/index.js new file mode 100644 index 00000000..b0c4ea21 --- /dev/null +++ b/node_modules/write-file-stdout/test/index.js @@ -0,0 +1,23 @@ + +var assert = require('assert'); +var fs = require('fs'); +var write = require('..'); + +describe('write-file-stdout', function () { + afterEach(function () { + if (fs.existsSync('fixture.txt')) fs.unlinkSync('fixture.txt'); + }); + + it('should write to a file', function () { + write('fixture.txt', 'test'); + assert.equal('test', fs.readFileSync('fixture.txt')); + }); + + it('should write to stdout', function (done) { + process.stdout.write = function (data) { + assert.equal('test', data); + done(); + }; + write('test'); + }); +}); \ No newline at end of file -- cgit v1.2.3