Skip to content

Commit e883163

Browse files
committed
build: lint ts files
1 parent 97a3374 commit e883163

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test": "TS_NODE_PROJECT='tests/tsconfig.json' TS_NODE_FILES=true nyc mocha --opts ./.mocha.opts",
1212
"check-node-version": "check-node-version --npm 11.6.2 --print",
1313
"test:ci": "npm test -- --forbid-only",
14-
"eslint": "eslint '{,!(node_modules|dist)/**/}*.js'",
14+
"eslint": "eslint '{,!(node_modules|dist)/**/}*.{js,ts}'",
1515
"markdownlint": "markdownlint-cli2",
1616
"standards": "npm run commitlint && npm run markdownlint && npm run eslint",
1717
"release:preview": "node ./node_modules/@silvermine/standardization/scripts/release.js preview",

tests/SubjectAuthorizer.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,39 @@ import { ADMINISTER_OWN_AUTH, ADMINISTER_OTHER_AUTH, DO_NEARLY_EVERYTHING } from
44

55

66
describe('SubjectAuthorizer', () => {
7-
const ALL_ROLES_1 = [
7+
const allRoles1 = [
88
ADMINISTER_OWN_AUTH,
99
ADMINISTER_OTHER_AUTH,
1010
];
1111

12-
const ALL_ROLES_2 = [
12+
const allRoles2 = [
1313
ADMINISTER_OWN_AUTH,
1414
ADMINISTER_OTHER_AUTH,
1515
DO_NEARLY_EVERYTHING,
1616
];
1717

18-
const USER_ID = '73885b55-2e0d-40bd-8cb3-2e59cf78ed87';
18+
const userID = '73885b55-2e0d-40bd-8cb3-2e59cf78ed87';
1919

20-
const USER: Claims = {
21-
subjectID: USER_ID,
20+
const user: Claims = {
21+
subjectID: userID,
2222
roles: [
2323
{ roleID: ADMINISTER_OWN_AUTH.roleID },
2424
{ roleID: ADMINISTER_OTHER_AUTH.roleID, contextValue: '8e0fa760-9a1d-43ea-8686-768318d923b4' },
2525
{ roleID: DO_NEARLY_EVERYTHING.roleID },
2626
],
2727
};
2828

29-
const factory1 = new AuthorizerFactory(ALL_ROLES_1),
30-
factory2 = new AuthorizerFactory(ALL_ROLES_2);
29+
const factory1 = new AuthorizerFactory(allRoles1),
30+
factory2 = new AuthorizerFactory(allRoles2);
3131

3232
it('ignores unknown roles when no opts provided', () => {
33-
expect(factory1.makeAuthorizerForSubject(USER)).to.be.ok; // eslint-disable-line no-unused-expressions
34-
expect(factory2.makeAuthorizerForSubject(USER)).to.be.ok; // eslint-disable-line no-unused-expressions
33+
expect(factory1.makeAuthorizerForSubject(user)).to.be.ok; // eslint-disable-line no-unused-expressions
34+
expect(factory2.makeAuthorizerForSubject(user)).to.be.ok; // eslint-disable-line no-unused-expressions
3535
});
3636

3737
it('throws an error on unknown roles when requested', () => {
38-
expect(() => { factory1.makeAuthorizerForSubject(USER, { throwOnUnknownRole: true }); }).to.throw();
39-
expect(factory2.makeAuthorizerForSubject(USER, { throwOnUnknownRole: true })).to.be.ok; // eslint-disable-line no-unused-expressions
38+
expect(() => { factory1.makeAuthorizerForSubject(user, { throwOnUnknownRole: true }); }).to.throw();
39+
expect(factory2.makeAuthorizerForSubject(user, { throwOnUnknownRole: true })).to.be.ok; // eslint-disable-line no-unused-expressions
4040
});
4141

4242
});

0 commit comments

Comments
 (0)