diff options
| author | XhmikosR <[email protected]> | 2020-04-24 00:46:49 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-23 14:46:49 -0700 |
| commit | a0c69414b7dbeef7aaefdb00ad78dff2a724b192 (patch) | |
| tree | a97078ca6f04e3297a652ad642e7ee3b505dcfa5 | |
| parent | 1615297a56f1eaa962ccf794c7b3596f8a146660 (diff) | |
| download | node-coveralls-a0c69414b7dbeef7aaefdb00ad78dff2a724b192.tar.xz node-coveralls-a0c69414b7dbeef7aaefdb00ad78dff2a724b192.zip | |
Move fixtures to test/fixtures. (#286)
| -rw-r--r-- | .jshintignore | 1 | ||||
| -rw-r--r-- | test/convertLcovToCoveralls.js | 19 | ||||
| -rw-r--r-- | test/fixtures/istanbul.lcov (renamed from fixtures/istanbul.lcov) | 0 | ||||
| -rw-r--r-- | test/fixtures/istanbul.remap.lcov (renamed from fixtures/istanbul.remap.lcov) | 0 | ||||
| -rw-r--r-- | test/fixtures/lib/index.js (renamed from fixtures/lib/index.js) | 0 | ||||
| -rw-r--r-- | test/fixtures/onefile.lcov (renamed from fixtures/onefile.lcov) | 0 | ||||
| -rw-r--r-- | test/handleInput.js | 10 |
7 files changed, 16 insertions, 14 deletions
diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 0000000..8be5c35 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +test/fixtures/ diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js index 92ee40d..eca48a9 100644 --- a/test/convertLcovToCoveralls.js +++ b/test/convertLcovToCoveralls.js @@ -11,9 +11,9 @@ logDriver({ level: false }); describe('convertLcovToCoveralls', () => { it('should convert a simple lcov file', done => { delete process.env.TRAVIS; - const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov'); + const lcovpath = path.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); - const libpath = path.join(__dirname, '/../fixtures/lib'); + const libpath = path.join(__dirname, './fixtures/lib'); convertLcovToCoveralls(input, { filepath: libpath }, (err, output) => { should.not.exist(err); output.source_files[0].name.should.equal('index.js'); @@ -37,7 +37,7 @@ describe('convertLcovToCoveralls', () => { process.env.COVERALLS_FLAG_NAME = 'FLAG_NAME'; getOptions((err, options) => { - const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov'); + const lcovpath = path.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); const libpath = 'fixtures/lib'; @@ -56,11 +56,12 @@ describe('convertLcovToCoveralls', () => { }); }); }); + it('should work with a relative path as well', done => { delete process.env.TRAVIS; - const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov'); + const lcovpath = path.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); - const libpath = 'fixtures/lib'; + const libpath = 'test/fixtures/lib'; convertLcovToCoveralls(input, { filepath: libpath }, (err, output) => { should.not.exist(err); output.source_files[0].name.should.equal('index.js'); @@ -71,7 +72,7 @@ describe('convertLcovToCoveralls', () => { it('should convert absolute input paths to relative', done => { delete process.env.TRAVIS; - const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov'); + const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib'; const sourcepath = path.resolve(libpath, 'svgo/config.js'); @@ -100,7 +101,7 @@ describe('convertLcovToCoveralls', () => { it('should handle branch coverage data', done => { process.env.TRAVIS_JOB_ID = -1; - const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov'); + const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib'; const sourcepath = path.resolve(libpath, 'svgo/config.js'); @@ -129,7 +130,7 @@ describe('convertLcovToCoveralls', () => { it('should ignore files that do not exists', done => { delete process.env.TRAVIS; - const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov'); + const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib'; const sourcepath = path.resolve(libpath, 'svgo/config.js'); @@ -158,7 +159,7 @@ describe('convertLcovToCoveralls', () => { it('should parse file paths concatenated by typescript and ng 2', done => { process.env.TRAVIS_JOB_ID = -1; - const lcovpath = path.join(__dirname, '/../fixtures/istanbul.remap.lcov'); + const lcovpath = path.join(__dirname, './fixtures/istanbul.remap.lcov'); const input = fs.readFileSync(lcovpath, 'utf8'); const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib'; const sourcepath = path.resolve(libpath, 'svgo/config.js'); diff --git a/fixtures/istanbul.lcov b/test/fixtures/istanbul.lcov index 64d8d64..64d8d64 100644 --- a/fixtures/istanbul.lcov +++ b/test/fixtures/istanbul.lcov diff --git a/fixtures/istanbul.remap.lcov b/test/fixtures/istanbul.remap.lcov index 8da5f83..8da5f83 100644 --- a/fixtures/istanbul.remap.lcov +++ b/test/fixtures/istanbul.remap.lcov diff --git a/fixtures/lib/index.js b/test/fixtures/lib/index.js index 052e296..052e296 100644 --- a/fixtures/lib/index.js +++ b/test/fixtures/lib/index.js diff --git a/fixtures/onefile.lcov b/test/fixtures/onefile.lcov index bc24682..bc24682 100644 --- a/fixtures/onefile.lcov +++ b/test/fixtures/onefile.lcov diff --git a/test/handleInput.js b/test/handleInput.js index 46cbe50..c46aa17 100644 --- a/test/handleInput.js +++ b/test/handleInput.js @@ -15,7 +15,7 @@ describe('handleInput', () => { }); it('returns an error when there\'s an error getting options', done => { sinon.stub(index, 'getOptions', cb => cb('some error', {})); - const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov'); + const path = sysPath.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(path, 'utf8'); index.handleInput(input, err => { err.should.equal('some error'); @@ -27,7 +27,7 @@ describe('handleInput', () => { sinon.stub(index, 'convertLcovToCoveralls', (input, options, cb) => { cb('some error'); }); - const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov'); + const path = sysPath.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(path, 'utf8'); index.handleInput(input, err => { err.should.equal('some error'); @@ -39,7 +39,7 @@ describe('handleInput', () => { sinon.stub(index, 'sendToCoveralls', (postData, cb) => { cb('some error'); }); - const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov'); + const path = sysPath.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(path, 'utf8'); index.handleInput(input, err => { err.should.equal('some error'); @@ -51,7 +51,7 @@ describe('handleInput', () => { sinon.stub(index, 'sendToCoveralls', (postData, cb) => { cb(null, { statusCode: 500 }, 'body'); }); - const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov'); + const path = sysPath.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(path, 'utf8'); index.handleInput(input, err => { err.should.equal('Bad response: 500 body'); @@ -63,7 +63,7 @@ describe('handleInput', () => { sinon.stub(index, 'sendToCoveralls', (postData, cb) => { cb(null, { statusCode: 200 }, 'body'); }); - const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov'); + const path = sysPath.join(__dirname, './fixtures/onefile.lcov'); const input = fs.readFileSync(path, 'utf8'); index.handleInput(input, (err, body) => { should.not.exist(err); |
