Skip to content

Commit a0c6941

Browse files
authoredApr 23, 2020
Move fixtures to test/fixtures. (#286)
1 parent 1615297 commit a0c6941

7 files changed

+16
-14
lines changed
 

‎.jshintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/fixtures/

‎test/convertLcovToCoveralls.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ logDriver({ level: false });
1111
describe('convertLcovToCoveralls', () => {
1212
it('should convert a simple lcov file', done => {
1313
delete process.env.TRAVIS;
14-
const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov');
14+
const lcovpath = path.join(__dirname, './fixtures/onefile.lcov');
1515
const input = fs.readFileSync(lcovpath, 'utf8');
16-
const libpath = path.join(__dirname, '/../fixtures/lib');
16+
const libpath = path.join(__dirname, './fixtures/lib');
1717
convertLcovToCoveralls(input, { filepath: libpath }, (err, output) => {
1818
should.not.exist(err);
1919
output.source_files[0].name.should.equal('index.js');
@@ -37,7 +37,7 @@ describe('convertLcovToCoveralls', () => {
3737
process.env.COVERALLS_FLAG_NAME = 'FLAG_NAME';
3838

3939
getOptions((err, options) => {
40-
const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov');
40+
const lcovpath = path.join(__dirname, './fixtures/onefile.lcov');
4141
const input = fs.readFileSync(lcovpath, 'utf8');
4242
const libpath = 'fixtures/lib';
4343

@@ -56,11 +56,12 @@ describe('convertLcovToCoveralls', () => {
5656
});
5757
});
5858
});
59+
5960
it('should work with a relative path as well', done => {
6061
delete process.env.TRAVIS;
61-
const lcovpath = path.join(__dirname, '/../fixtures/onefile.lcov');
62+
const lcovpath = path.join(__dirname, './fixtures/onefile.lcov');
6263
const input = fs.readFileSync(lcovpath, 'utf8');
63-
const libpath = 'fixtures/lib';
64+
const libpath = 'test/fixtures/lib';
6465
convertLcovToCoveralls(input, { filepath: libpath }, (err, output) => {
6566
should.not.exist(err);
6667
output.source_files[0].name.should.equal('index.js');
@@ -71,7 +72,7 @@ describe('convertLcovToCoveralls', () => {
7172

7273
it('should convert absolute input paths to relative', done => {
7374
delete process.env.TRAVIS;
74-
const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov');
75+
const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov');
7576
const input = fs.readFileSync(lcovpath, 'utf8');
7677
const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib';
7778
const sourcepath = path.resolve(libpath, 'svgo/config.js');
@@ -100,7 +101,7 @@ describe('convertLcovToCoveralls', () => {
100101

101102
it('should handle branch coverage data', done => {
102103
process.env.TRAVIS_JOB_ID = -1;
103-
const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov');
104+
const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov');
104105
const input = fs.readFileSync(lcovpath, 'utf8');
105106
const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib';
106107
const sourcepath = path.resolve(libpath, 'svgo/config.js');
@@ -129,7 +130,7 @@ describe('convertLcovToCoveralls', () => {
129130

130131
it('should ignore files that do not exists', done => {
131132
delete process.env.TRAVIS;
132-
const lcovpath = path.join(__dirname, '/../fixtures/istanbul.lcov');
133+
const lcovpath = path.join(__dirname, './fixtures/istanbul.lcov');
133134
const input = fs.readFileSync(lcovpath, 'utf8');
134135
const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib';
135136
const sourcepath = path.resolve(libpath, 'svgo/config.js');
@@ -158,7 +159,7 @@ describe('convertLcovToCoveralls', () => {
158159

159160
it('should parse file paths concatenated by typescript and ng 2', done => {
160161
process.env.TRAVIS_JOB_ID = -1;
161-
const lcovpath = path.join(__dirname, '/../fixtures/istanbul.remap.lcov');
162+
const lcovpath = path.join(__dirname, './fixtures/istanbul.remap.lcov');
162163
const input = fs.readFileSync(lcovpath, 'utf8');
163164
const libpath = '/Users/deepsweet/Dropbox/projects/svgo/lib';
164165
const sourcepath = path.resolve(libpath, 'svgo/config.js');
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎test/handleInput.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('handleInput', () => {
1515
});
1616
it('returns an error when there\'s an error getting options', done => {
1717
sinon.stub(index, 'getOptions', cb => cb('some error', {}));
18-
const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov');
18+
const path = sysPath.join(__dirname, './fixtures/onefile.lcov');
1919
const input = fs.readFileSync(path, 'utf8');
2020
index.handleInput(input, err => {
2121
err.should.equal('some error');
@@ -27,7 +27,7 @@ describe('handleInput', () => {
2727
sinon.stub(index, 'convertLcovToCoveralls', (input, options, cb) => {
2828
cb('some error');
2929
});
30-
const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov');
30+
const path = sysPath.join(__dirname, './fixtures/onefile.lcov');
3131
const input = fs.readFileSync(path, 'utf8');
3232
index.handleInput(input, err => {
3333
err.should.equal('some error');
@@ -39,7 +39,7 @@ describe('handleInput', () => {
3939
sinon.stub(index, 'sendToCoveralls', (postData, cb) => {
4040
cb('some error');
4141
});
42-
const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov');
42+
const path = sysPath.join(__dirname, './fixtures/onefile.lcov');
4343
const input = fs.readFileSync(path, 'utf8');
4444
index.handleInput(input, err => {
4545
err.should.equal('some error');
@@ -51,7 +51,7 @@ describe('handleInput', () => {
5151
sinon.stub(index, 'sendToCoveralls', (postData, cb) => {
5252
cb(null, { statusCode: 500 }, 'body');
5353
});
54-
const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov');
54+
const path = sysPath.join(__dirname, './fixtures/onefile.lcov');
5555
const input = fs.readFileSync(path, 'utf8');
5656
index.handleInput(input, err => {
5757
err.should.equal('Bad response: 500 body');
@@ -63,7 +63,7 @@ describe('handleInput', () => {
6363
sinon.stub(index, 'sendToCoveralls', (postData, cb) => {
6464
cb(null, { statusCode: 200 }, 'body');
6565
});
66-
const path = sysPath.join(__dirname, '/../fixtures/onefile.lcov');
66+
const path = sysPath.join(__dirname, './fixtures/onefile.lcov');
6767
const input = fs.readFileSync(path, 'utf8');
6868
index.handleInput(input, (err, body) => {
6969
should.not.exist(err);

0 commit comments

Comments
 (0)
Please sign in to comment.