From dc83a00b1efd59d6fb2dff537817ad9bd82c4161 Mon Sep 17 00:00:00 2001 From: Leonardo Andres Garcia Crespo Date: Fri, 27 May 2016 16:18:12 -0300 Subject: [PATCH] Explain why we use trim when reading test file contents --- test/index.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/index.spec.js b/test/index.spec.js index 8b8a59c..b3b8e49 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -25,6 +25,11 @@ describe('babel-plugin-css-modules-transform', () => { } function readExpected(path) { + // We trim the contents of the file so that we don't have + // to deal with newline issues, since some text editors + // automatically inserts them. It's easier to do this than to + // configure the editors to avoid inserting newlines for these + // particular files. return readFileSync(resolve(__dirname, path), 'utf8').trim(); }