Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
debug napi
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Jul 19, 2018
1 parent 571a769 commit 9f31dfd
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var assert = require('assert'),
stream = require('stream'),
spawn = require('cross-spawn'),
cli = path.join(__dirname, '..', 'bin', 'node-sass'),
sass = require('../lib'),
fixture = path.join.bind(null, __dirname, 'fixtures');

function isNapiError(error) {
Expand Down Expand Up @@ -452,7 +453,7 @@ describe('cli', function() {
});
});

it('should compile with the --source-map-embed option and no outfile', function(done) {
it.only('should compile with the --source-map-embed option and no outfile', function(done) {
var src = fixture('source-map-embed/index.scss');
var expectedCss = read(fixture('source-map-embed/expected.css'), 'utf8').trim().replace(/\r\n/g, '\n');
var result = '';
Expand All @@ -462,11 +463,29 @@ describe('cli', function() {
'--source-map', 'true'
]);

// sass.render({
// file: src,
// sourceMapEmbed: true,
// sourceMap: true,
// }, function(err, results) {
// console.log('err:', err);
// console.log('results:', results.css.toString());
// console.log('expectedCss:', expectedCss);
// console.log(results.css.toString() === expectedCss);
// });

bin.stdout.on('data', function(data) {
// console.log('stdout', data.toString());
result += data;
});

bin.stderr.on('data', function(data) {
// console.log('stderr', data.toString());
});

bin.once('close', function() {
// console.log('raw result:', result.toString());
// console.log('trimmed result:', result.trim().replace(/\r\n/g, '\n'));
assert.equal(result.trim().replace(/\r\n/g, '\n'), expectedCss);
done();
});
Expand Down

0 comments on commit 9f31dfd

Please sign in to comment.