Skip to content

Commit

Permalink
feat: add support --line-numbers option
Browse files Browse the repository at this point in the history
  • Loading branch information
cap-Bernardito committed Sep 28, 2020
1 parent 777bcaf commit 3782f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/__snapshots__/loader.test.js.snap
Expand Up @@ -717,16 +717,16 @@ exports[`loader should work "include" option: warnings 1`] = `Array []`;

exports[`loader should work "lineNumbers" option: css 1`] = `
"
/* line 10 : /media/veracrypt1/OS/stylus-loader/test/fixtures/basic.styl */
/* line 10 : /test/fixtures/basic.styl */
/* line 1 : /media/veracrypt1/OS/stylus-loader/node_modules/stylus/lib/functions/index.styl */
/* line 1 : /node_modules/stylus/lib/functions/index.styl */
/* line 6 : /media/veracrypt1/OS/stylus-loader/test/fixtures/basic.styl */
/* line 6 : /test/fixtures/basic.styl */
body {
font: 12px Helvetica, Arial, sans-serif;
}
/* line 9 : /media/veracrypt1/OS/stylus-loader/test/fixtures/basic.styl */
/* line 9 : /test/fixtures/basic.styl */
a.button {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
Expand Down
6 changes: 5 additions & 1 deletion test/loader.test.js
Expand Up @@ -1320,8 +1320,12 @@ describe('loader', () => {
},
});

const codeWithoutCwd = codeFromBundle.css
.replace(/\\/g, '/')
.replace(new RegExp(process.cwd(), 'g'), '');

expect(codeFromBundle.css).toBe(codeFromStylus.css);
expect(codeFromBundle.css).toMatchSnapshot('css');
expect(codeWithoutCwd).toMatchSnapshot('css');
expect(getWarnings(stats)).toMatchSnapshot('warnings');
expect(getErrors(stats)).toMatchSnapshot('errors');
});
Expand Down

0 comments on commit 3782f2f

Please sign in to comment.