Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dancastillo committed Aug 9, 2024
1 parent d9d778a commit bd3361a
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
coverage
1 change: 1 addition & 0 deletions test/authorize.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import { RouteHandlerMethod } from 'fastify'
Expand Down
1 change: 1 addition & 0 deletions test/csrf-fixation.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe, beforeEach } from 'node:test'
import assert from 'node:assert'
import { getConfiguredTestServer, TestBrowserSession } from './helpers'
Expand Down
1 change: 1 addition & 0 deletions test/decorators.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import { getConfiguredTestServer, TestStrategy } from './helpers'
Expand Down
1 change: 1 addition & 0 deletions test/esm/esm.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import { spawnSync } from 'node:child_process'
Expand Down
1 change: 1 addition & 0 deletions test/independent-strategy-instances.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import { Strategy } from '../src/strategies'
Expand Down
1 change: 1 addition & 0 deletions test/multi-instance.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe, beforeEach } from 'node:test'
import assert from 'node:assert'
import { FastifyInstance } from 'fastify'
Expand Down
1 change: 1 addition & 0 deletions test/passport.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import got from 'got'
Expand Down
9 changes: 5 additions & 4 deletions test/secure-session-manager.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe, mock } from 'node:test'
import assert from 'node:assert'
import { FastifyRequest } from 'fastify'
Expand All @@ -7,7 +8,7 @@ import { SecureSessionManager } from '../src/session-managers/SecureSessionManag
describe('SecureSessionManager', () => {
test('should throw an Error if no parameter was passed', () => {
assert.throws(
// @ts-ignore - strictEqual-error expecting atleast a parameter
// @ts-expect-error - strictEqual-error expecting atleast a parameter
() => new SecureSessionManager(),
(err) => {
assert(err instanceof Error)
Expand All @@ -22,7 +23,7 @@ describe('SecureSessionManager', () => {

test('should throw an Error if no serializeUser-function was passed as second parameter', () => {
assert.throws(
// @ts-ignore - strictEqual-error expecting a function as second parameter
// @ts-expect-error - strictEqual-error expecting a function as second parameter
() => new SecureSessionManager({}),
(err) => {
assert(err instanceof Error)
Expand All @@ -37,7 +38,7 @@ describe('SecureSessionManager', () => {

test('should throw an Error if no serializeUser-function was passed as second parameter', () => {
assert.throws(
// @ts-ignore - strictEqual-error expecting a function as second parameter
// @ts-expect-error - strictEqual-error expecting a function as second parameter
() => new SecureSessionManager({}),
(err) => {
assert(err instanceof Error)
Expand Down Expand Up @@ -67,7 +68,7 @@ describe('SecureSessionManager', () => {
})

test('should ignore non-string keys', () => {
// @ts-ignore - strictEqual-error key has to be of type string
// @ts-expect-error - strictEqual-error key has to be of type string
const sessionManager = new SecureSessionManager({ key: 1 }, ((id) => id) as unknown as SerializeFunction)
assert.strictEqual(sessionManager.key, 'passport')
})
Expand Down
1 change: 1 addition & 0 deletions test/session-isolation.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe, beforeEach } from 'node:test'
import assert from 'node:assert'
import { generateTestUser, getConfiguredTestServer, TestBrowserSession } from './helpers'
Expand Down
1 change: 1 addition & 0 deletions test/session-serialization.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe, mock } from 'node:test'
import assert from 'node:assert'
import { FastifyInstance } from 'fastify'
Expand Down
7 changes: 4 additions & 3 deletions test/session-strategy.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import { SerializeFunction } from '../src/Authenticator'
Expand All @@ -6,7 +7,7 @@ import { SessionStrategy } from '../src/strategies/SessionStrategy'
describe('SessionStrategy', () => {
test('should throw an Error if no parameter was passed', () => {
assert.throws(
// @ts-ignore.strictEqual-error expecting atleast a parameter
// @ts-expect-error.strictEqual-error expecting atleast a parameter
() => new SessionStrategy(),
(err) => {
assert(err instanceof Error)
Expand All @@ -21,7 +22,7 @@ describe('SessionStrategy', () => {

test('should throw an Error if no deserializeUser-function was passed as second parameter', () => {
assert.throws(
// @ts-ignore.strictEqual-error expecting a function as second parameter
// @ts-expect-error.strictEqual-error expecting a function as second parameter
() => new SessionStrategy({}),
(err) => {
assert(err instanceof Error)
Expand All @@ -36,7 +37,7 @@ describe('SessionStrategy', () => {

test('should throw an Error if no deserializeUser-function was passed as second parameter', () => {
assert.throws(
// @ts-ignore.strictEqual-error expecting a function as second parameter
// @ts-expect-error.strictEqual-error expecting a function as second parameter
() => new SessionStrategy({}),
(err) => {
assert(err instanceof Error)
Expand Down
1 change: 1 addition & 0 deletions test/strategies-integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert, { fail } from 'node:assert'
import { Strategy as FacebookStrategy } from 'passport-facebook'
Expand Down
3 changes: 2 additions & 1 deletion test/strategy.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { test, describe } from 'node:test'
import assert from 'node:assert'
import Authenticator from '../src/Authenticator'
Expand All @@ -13,7 +14,7 @@ const testSuite = (sessionPluginName: string) => {
fastifyPassport.unuse('test')
})

test('should throw error if strategy has no name', (t) => {
test('should throw error if strategy has no name', () => {
const fastifyPassport = new Authenticator()
assert.throws(() => {
fastifyPassport.use({} as Strategy)
Expand Down

0 comments on commit bd3361a

Please sign in to comment.