ryepup/c4-lab

View on GitHub
__mocks__/LocalStorage.ts

Summary

Maintainability
A
0 mins
Test Coverage
export default class LocalStorageMock implements Storage {
    [index: number]: string;
    [key: string]: any;
    public length: number = 0
    public clear(): void {
        throw new Error('Method not implemented.')
    }
    public getItem(key: string): string | null {
        return this[key]
    }
    public key(index: number): string | null {
        throw new Error('Method not implemented.')
    }
    public removeItem(key: string): void {
        throw new Error('Method not implemented.')
    }
    public setItem(key: string, data: string): void {
        this.length++
        this[key] = data
    }
}