Skip to content

Commit abd6235

Browse files
Merge pull request #12 from leoasis/explain_trim_in_tests
Explain why we use trim when reading test file contents
2 parents c84954c + dc83a00 commit abd6235

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ describe('babel-plugin-css-modules-transform', () => {
2525
}
2626

2727
function readExpected(path) {
28+
// We trim the contents of the file so that we don't have
29+
// to deal with newline issues, since some text editors
30+
// automatically inserts them. It's easier to do this than to
31+
// configure the editors to avoid inserting newlines for these
32+
// particular files.
2833
return readFileSync(resolve(__dirname, path), 'utf8').trim();
2934
}
3035

0 commit comments

Comments
 (0)