Skip to content

Commit ae7f44e

Browse files
committed
style(test): remove comma-dangle from tests files
1 parent 87b40f2 commit ae7f44e

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module.exports = {
4141
},
4242
rules: {
4343
'@stylistic/js/arrow-parens': ['error', 'always'],
44+
'@stylistic/js/comma-dangle': ['error', 'never'],
4445
}
4546
}
4647
]

test/fail.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ describe('Fail after error', () => {
7979
await new Promise((resolve, reject) => {
8080
stream
8181
.pipe(gStylelintEsm({
82-
config: { rules: { 'color-hex-length': 'short' } },
82+
config: { rules: { 'color-hex-length': 'short' } }
8383
}))
8484
.on('error', (error) => {
8585
errorEmitted = true;
@@ -104,7 +104,7 @@ describe('Fail after error', () => {
104104
stream
105105
.pipe(gStylelintEsm({
106106
failAfterError: true,
107-
config: { rules: { 'color-hex-length': 'short' } },
107+
config: { rules: { 'color-hex-length': 'short' } }
108108
}))
109109
.on('error', (error) => {
110110
errorEmitted = true;

test/index.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('Plugin Functionality', () => {
2929
});
3030
it('should emit an error on streamed file', (done) => {
3131
const stream = src(fixtures('basic.css'), {
32-
buffer: false,
32+
buffer: false
3333
});
3434

3535
stream
@@ -42,7 +42,7 @@ describe('Plugin Functionality', () => {
4242
});
4343
it('should not emit an error on buffered file', (done) => {
4444
const stream = src(fixtures('basic.css'), {
45-
buffer: true,
45+
buffer: true
4646
});
4747

4848
stream
@@ -82,7 +82,7 @@ describe('Plugin Functionality', () => {
8282
it('should throw an error when linter complains', async () => {
8383
const stream = gStylelintEsm({
8484
config: { rules: { 'color-hex-length': 'short' } },
85-
reporters: [],
85+
reporters: []
8686
});
8787

8888
const file = createVinylFile('invalid.css', '.foo { color: #ffffff; }');
@@ -132,7 +132,7 @@ describe('Plugin Functionality', () => {
132132
stream
133133
.pipe(gStylelintEsm({
134134
config: { rules: { 'color-hex-length': 'short' } },
135-
fix: true,
135+
fix: true
136136
}))
137137
.on('error', reject)
138138
.on('finish', resolve);
@@ -172,7 +172,7 @@ describe('Plugin Functionality', () => {
172172
stream
173173
.pipe(gStylelintEsm({
174174
config: { rules: { 'color-hex-length': 'short' } },
175-
fix: true,
175+
fix: true
176176
}))
177177
.on('error', reject)
178178
.pipe(dest(outputDir))

test/reporter-factory.test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ describe('Reporter Functionality', () => {
2424
const reporter = reporterFactory({
2525
formatter() {
2626
// empty formatter
27-
},
27+
}
2828
});
2929

3030
expect(typeof reporter({}).then).toBe('function');
3131
});
3232
});
33-
describe('Reporter Behavior with console', () => {
33+
describe('Reporter behavior with console', () => {
3434
it('reporter should write to console when console param is true', () => {
3535
stub(process.stdout, 'write');
3636
const reporter = reporterFactory({
@@ -61,7 +61,7 @@ describe('Reporter Behavior with console', () => {
6161
stub(process.stdout, 'write');
6262
const reporter = reporterFactory({
6363
formatter() { return ' \n'; },
64-
console: true,
64+
console: true
6565
});
6666

6767
reporter({});
@@ -73,7 +73,7 @@ describe('Reporter Behavior with console', () => {
7373
it('reporter should NOT write to console when console param is undefined', () => {
7474
stub(process.stdout, 'write');
7575
const reporter = reporterFactory({
76-
formatter() { return 'foo'; },
76+
formatter() { return 'foo'; }
7777
});
7878

7979
reporter({});
@@ -83,13 +83,13 @@ describe('Reporter Behavior with console', () => {
8383
process.stdout.write.restore();
8484
});
8585
});
86-
describe('Reporter Behavior with log file', () => {
86+
describe('Reporter behavior with log file', () => {
8787
it('reporter should writes a file when formatter returns a string', async () => {
8888
const logFilePath = path.resolve(__dirname, 'foo.txt');
8989

9090
const reporter = reporterFactory({
9191
formatter() { return 'test content'; },
92-
log: logFilePath,
92+
log: logFilePath
9393
});
9494

9595
await reporter({});
@@ -105,7 +105,7 @@ describe('Reporter Behavior with log file', () => {
105105

106106
const reporter = reporterFactory({
107107
formatter() { return 'test content'; },
108-
log: logFilePath,
108+
log: logFilePath
109109
});
110110

111111
await reporter({});
@@ -121,7 +121,7 @@ describe('Reporter Behavior with log file', () => {
121121

122122
const reporter = reporterFactory({
123123
formatter() { return ''; },
124-
log: logFilePath,
124+
log: logFilePath
125125
});
126126

127127
await reporter({});
@@ -135,7 +135,7 @@ describe('Reporter Behavior with log file', () => {
135135
const logFilePath = path.resolve(__dirname, 'foo.txt');
136136

137137
const reporter = reporterFactory({
138-
formatter() { return 'foo'; },
138+
formatter() { return 'foo'; }
139139
});
140140

141141
await reporter({});

0 commit comments

Comments
 (0)