You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
407 B
21 lines
407 B
import { beforeAll } from 'vitest'
|
|
|
|
beforeAll(() => {
|
|
// 设置全局 mocks
|
|
global.localStorage = {
|
|
store: {},
|
|
getItem: function (key) {
|
|
return this.store[key] || null
|
|
},
|
|
setItem: function (key, value) {
|
|
this.store[key] = value.toString()
|
|
},
|
|
removeItem: function (key) {
|
|
delete this.store[key]
|
|
},
|
|
clear: function () {
|
|
this.store = {}
|
|
}
|
|
}
|
|
})
|