Skip to content

Commit

Permalink
[Tests] fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 3, 2020
1 parent 8476b91 commit 0df3070
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs",
"test:shams:corejs": "nyc --no-clean node test/shams/core-js.js",
"test:shams:getownpropertysymbols": "nyc --no-clean node test/shams/get-own-property-symbols.js",
"lint": "eslint *.js",
"lint": "eslint --ext=js,mjs .",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
Expand Down
2 changes: 1 addition & 1 deletion shams.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function hasSymbols() {

var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }

if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var hasSymbols = require('../');
var runSymbolTests = require('./tests');

test('interface', function (t) {
t.equal(typeof hasSymbols, 'function', 'is a function');
t.equal(typeof hasSymbols, 'function', 'is a function');
t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean');
t.end();
});
Expand Down
6 changes: 4 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';

// eslint-disable-next-line consistent-return
module.exports = function runSymbolTests(t) {
t.equal(typeof Symbol, 'function', 'global Symbol is a function');

if (typeof Symbol !== 'function') { return false };
if (typeof Symbol !== 'function') { return false; }

t.notEqual(Symbol(), Symbol(), 'two symbols are not equal');

Expand All @@ -15,9 +16,9 @@ module.exports = function runSymbolTests(t) {
);
*/

/*
var foo = Symbol('foo');
/*
t.notEqual(
String(foo),
String(Symbol('bar')),
Expand All @@ -39,6 +40,7 @@ module.exports = function runSymbolTests(t) {

var symVal = 42;
obj[sym] = symVal;
// eslint-disable-next-line no-restricted-syntax
for (sym in obj) { t.fail('symbol property key was found in for..in of object'); }

t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object');
Expand Down

0 comments on commit 0df3070

Please # to comment.