Skip to content

Commit bf229d9

Browse files
committed
Add linting for tests
The tests are currently not linted. This causes a different coding style than the rest of the sources. This patch adds the `./test` directory to the eslint testing and fixes linting for existing tests. Signed-off-by: Sheogorath <[email protected]>
1 parent d408f4c commit bf229d9

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "AGPL-3.0",
77
"scripts": {
88
"test": "npm run-script eslint && npm run-script jsonlint && mocha",
9-
"eslint": "node_modules/.bin/eslint lib public app.js",
9+
"eslint": "node_modules/.bin/eslint lib public test app.js",
1010
"jsonlint": "find . -not -path './node_modules/*' -type f -name '*.json' -o -type f -name '*.json.example' | while read json; do echo $json ; jq . $json; done",
1111
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
1212
"dev": "webpack --config webpack.dev.js --progress --colors --watch",

test/letter-avatars.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
/* eslint-env node, mocha */
2+
13
'use strict'
24

3-
const assert = require('assert');
5+
const assert = require('assert')
46
const avatars = require('../lib/letter-avatars')
57

6-
describe('generateAvatarURL()', function() {
7-
it('should return correct urls', function() {
8-
assert.equal(avatars.generateAvatarURL('Daan Sprenkels', '[email protected]', true), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400');
9-
assert.equal(avatars.generateAvatarURL('Daan Sprenkels', '[email protected]', false), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96');
10-
});
11-
});
8+
describe('generateAvatarURL()', function () {
9+
it('should return correct urls', function () {
10+
assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', '[email protected]', true), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400')
11+
assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', '[email protected]', false), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96')
12+
})
13+
})

0 commit comments

Comments
 (0)