Skip to content

Commit 0f80c54

Browse files
fix: clean code
1 parent 2a770ff commit 0f80c54

4 files changed

Lines changed: 4 additions & 97 deletions

File tree

packages/feathers-localforage/.codeclimate.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

packages/feathers-localforage/.nycrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/feathers-localforage/test/utilities/local-storage-test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import assert from 'assert'
22
import { LocalStorage } from './local-storage.js'
33
import { describe, it, afterAll as after } from 'vitest'
44

5-
// We don't make `localStorage` global here, as we'r simply testing it locally
65
const localStorage = new LocalStorage()
76

87
export default () => {

packages/feathers-localforage/vitest.setup.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
import { vi, beforeEach, afterEach, beforeAll, afterAll, describe, it, expect } from 'vitest'
1+
import { vi, beforeEach, afterEach, beforeAll, afterAll } from 'vitest'
22

3-
// polyfills globaux
3+
// Pour mocha @feathersjs/adapter-tests
44
global.before = beforeAll
55
global.after = afterAll
6-
global.beforeEach = beforeEach
7-
global.afterEach = afterEach
8-
global.describe = describe
9-
global.it = it
10-
global.expect = expect
116

12-
// Mock store partagé
7+
// Mock store avec Map
138
const mockStore = new Map()
149

1510
// Factory d’instance LocalForage
@@ -44,8 +39,6 @@ const createLocalForageInstance = () => ({
4439
vi.mock('localforage', () => {
4540
const mockLocalForage = {
4641
createInstance: vi.fn(config => createLocalForageInstance(config)),
47-
48-
// Valeurs statiques si ton code les utilise
4942
INDEXEDDB: 1,
5043
WEBSQL: 2,
5144
LOCALSTORAGE: 3
@@ -56,15 +49,14 @@ vi.mock('localforage', () => {
5649
}
5750
})
5851

59-
// Global LocalForage (si ton code y accède aussi via global)
6052
global.LocalForage = {
6153
createInstances: vi.fn(config => createLocalForageInstance(config)),
6254
INDEXEDDB: 1,
6355
WEBSQL: 2,
6456
LOCALSTORAGE: 3
6557
}
6658

67-
// Reset avant/après
59+
// Resets
6860
beforeEach(() => {
6961
mockStore.clear()
7062
vi.clearAllMocks()

0 commit comments

Comments
 (0)