Merge pull request #1123 from SISheogorath/fix/lintingTests
Add linting for tests
This commit is contained in:
commit
d69edd1def
2 changed files with 10 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "npm run-script eslint && npm run-script jsonlint && mocha",
|
"test": "npm run-script eslint && npm run-script jsonlint && mocha",
|
||||||
"eslint": "node_modules/.bin/eslint lib public app.js",
|
"eslint": "node_modules/.bin/eslint lib public test app.js",
|
||||||
"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",
|
"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",
|
||||||
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
|
"standard": "echo 'standard is no longer being used, use `npm run eslint` instead!' && exit 1",
|
||||||
"dev": "webpack --config webpack.dev.js --progress --colors --watch",
|
"dev": "webpack --config webpack.dev.js --progress --colors --watch",
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
/* eslint-env node, mocha */
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert')
|
||||||
const avatars = require('../lib/letter-avatars')
|
const avatars = require('../lib/letter-avatars')
|
||||||
|
|
||||||
describe('generateAvatarURL()', function () {
|
describe('generateAvatarURL()', function () {
|
||||||
it('should return correct urls', function () {
|
it('should return correct urls', function () {
|
||||||
assert.equal(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', true), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400');
|
assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', true), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=400')
|
||||||
assert.equal(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', false), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96');
|
assert.strictEqual(avatars.generateAvatarURL('Daan Sprenkels', 'hello@dsprenkels.com', false), 'https://www.gravatar.com/avatar/d41b5f3508cc3f31865566a47dd0336b?s=96')
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
Loading…
Reference in a new issue