✨ new storeDefault
option #1
#16
Annotations
20 errors and 2 warnings
test/browser.test.tsx > useLocalStorageState() > defaultValue accepts lazy initializer (like useState):
test/browser.test.tsx#L48
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:48:23
|
test/browser.test.tsx > useLocalStorageState() > initial state is written into the state:
test/browser.test.tsx#L57
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:57:23
|
test/browser.test.tsx > useLocalStorageState() > initial state is written to localStorage:
test/browser.test.tsx#L63
AssertionError: expected null to strictly equal '["first","second"]'
- Expected:
"[\"first\",\"second\"]"
+ Received:
null
❯ test/browser.test.tsx:63:47
|
test/browser.test.tsx > useLocalStorageState() > updates state with callback function:
test/browser.test.tsx#L90
TypeError: value is not iterable
❯ test/browser.test.tsx:90:37
❯ src/useStorageState.js:64:54
❯ test/browser.test.tsx:90:13
❯ node_modules/@testing-library/react/dist/act-compat.js:48:24
❯ act node_modules/react/cjs/react.development.js:2512:16
❯ Proxy.<anonymous> node_modules/@testing-library/react/dist/act-compat.js:47:25
❯ test/browser.test.tsx:87:9
|
test/browser.test.tsx > useLocalStorageState() > `defaultValue` can be set to `null`:
test/browser.test.tsx#L201
AssertionError: expected undefined to be null // Object.is equality
- Expected:
null
+ Received:
undefined
❯ test/browser.test.tsx:201:23
|
test/browser.test.tsx > useLocalStorageState() > can reset value to default:
test/browser.test.tsx#L248
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:248:23
|
test/browser.test.tsx > useLocalStorageState() > basic setup with default value:
test/browser.test.tsx#L354
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:354:23
|
test/browser.test.tsx > useLocalStorageState() > supports changing the key:
test/browser.test.tsx#L381
AssertionError: expected null to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
null
❯ test/browser.test.tsx:381:61
|
test/browser.test.tsx > useLocalStorageState() > setState() shouldn't change between renders:
test/browser.test.tsx#L424
AssertionError: expected null to be truthy
- Expected:
null
+ Received:
false
❯ test/browser.test.tsx:424:37
|
test/browser.test.tsx > useLocalStorageState() > setState() during render:
test/browser.test.tsx#L444
AssertionError: expected null to be truthy
- Expected:
null
+ Received:
false
❯ test/browser.test.tsx:444:37
|
test/browser.test.tsx > useLocalStorageState() > defaultValue accepts lazy initializer (like useState):
test/browser.test.tsx#L48
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:48:23
|
test/browser.test.tsx > useLocalStorageState() > initial state is written into the state:
test/browser.test.tsx#L57
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:57:23
|
test/browser.test.tsx > useLocalStorageState() > initial state is written to localStorage:
test/browser.test.tsx#L63
AssertionError: expected null to strictly equal '["first","second"]'
- Expected:
"[\"first\",\"second\"]"
+ Received:
null
❯ test/browser.test.tsx:63:47
|
test/browser.test.tsx > useLocalStorageState() > updates state with callback function:
test/browser.test.tsx#L90
TypeError: value is not iterable
❯ test/browser.test.tsx:90:37
❯ src/useStorageState.js:64:54
❯ test/browser.test.tsx:90:13
❯ node_modules/@testing-library/react/dist/act-compat.js:48:24
❯ act node_modules/react/cjs/react.development.js:2512:16
❯ Proxy.<anonymous> node_modules/@testing-library/react/dist/act-compat.js:47:25
❯ test/browser.test.tsx:87:9
|
test/browser.test.tsx > useLocalStorageState() > `defaultValue` can be set to `null`:
test/browser.test.tsx#L201
AssertionError: expected undefined to be null // Object.is equality
- Expected:
null
+ Received:
undefined
❯ test/browser.test.tsx:201:23
|
test/browser.test.tsx > useLocalStorageState() > can reset value to default:
test/browser.test.tsx#L248
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:248:23
|
test/browser.test.tsx > useLocalStorageState() > basic setup with default value:
test/browser.test.tsx#L354
AssertionError: expected undefined to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
undefined
❯ test/browser.test.tsx:354:23
|
test/browser.test.tsx > useLocalStorageState() > supports changing the key:
test/browser.test.tsx#L381
AssertionError: expected null to strictly equal [ 'first', 'second' ]
- Expected:
Array [
"first",
"second",
]
+ Received:
null
❯ test/browser.test.tsx:381:61
|
test/browser.test.tsx > useLocalStorageState() > setState() shouldn't change between renders:
test/browser.test.tsx#L424
AssertionError: expected null to be truthy
- Expected:
null
+ Received:
false
❯ test/browser.test.tsx:424:37
|
test/browser.test.tsx > useLocalStorageState() > setState() during render:
test/browser.test.tsx#L444
AssertionError: expected null to be truthy
- Expected:
null
+ Received:
false
❯ test/browser.test.tsx:444:37
|
Node.js 18
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/checkout@v3, actions/setup-node@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
Node.js 20
The following actions uses Node.js version which is deprecated and will be forced to run on node20: actions/checkout@v3, actions/setup-node@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|