Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6c950c7

Browse files
committed
(test): ensure node env w/ localStorage errors out
- add node test to reach 100% code coverage!- would prefer this test be in the same file as the others, but unfortunately jest only allows setting jest-environment on a per file basis, not on a per test or per test suite basis :/
1 parent8281b53 commit6c950c7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎test/index.node.spec.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
*@jest-environment node
3+
*/
4+
// add tests in this file that are specific to node (vs. jsdom)
5+
6+
/// <reference types="@types/jest" />
7+
8+
import{persist}from'../src/index'
9+
import{UserStoreF}from'./fixtures'
10+
11+
describe('node usage',()=>{
12+
it('should error on default localStorage usage',async()=>{
13+
constuser=UserStoreF.create()
14+
awaitexpect(persist('user',user)).rejects.toMatch(/^localStorage.+$/)
15+
})
16+
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp