🐛 fix(vscode): stateJson 测试里的动态 import 补上 .js 后缀,typecheck 重新通过
This commit is contained in:
1 parent
6a1750b2b1
commit
c009187f6c
1 file changed
+4
-4
@@ -397,18 +397,18 @@ describe('deleteLocalBranch', () => {
|
|||||||
|
|
||||||
describe('hasStateColumn', () => {
|
describe('hasStateColumn', () => {
|
||||||
it('带 column 的 state JSON → true', async () => {
|
it('带 column 的 state JSON → true', async () => {
|
||||||
const { hasStateColumn } = await import('../../src/gitea/stateJson')
|
const { hasStateColumn } = await import('../../src/gitea/stateJson.js')
|
||||||
expect(hasStateColumn('{"column":"done","pr":"318"}')).toBe(true)
|
expect(hasStateColumn('{"column":"done","pr":"318"}')).toBe(true)
|
||||||
expect(hasStateColumn(' {"column":"in-progress"} ')).toBe(true)
|
expect(hasStateColumn(' {"column":"in-progress"} ')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('没有 column 的 state JSON → false', async () => {
|
it('没有 column 的 state JSON → false', async () => {
|
||||||
const { hasStateColumn } = await import('../../src/gitea/stateJson')
|
const { hasStateColumn } = await import('../../src/gitea/stateJson.js')
|
||||||
expect(hasStateColumn('{"pr":"318","branch":"feature/x"}')).toBe(false)
|
expect(hasStateColumn('{"pr":"318","branch":"feature/x"}')).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('普通文本、审查评论、空值 → false', async () => {
|
it('普通文本、审查评论、空值 → false', async () => {
|
||||||
const { hasStateColumn } = await import('../../src/gitea/stateJson')
|
const { hasStateColumn } = await import('../../src/gitea/stateJson.js')
|
||||||
expect(hasStateColumn('<!-- spx:review=1 -->\n看着没问题')).toBe(false)
|
expect(hasStateColumn('<!-- spx:review=1 -->\n看着没问题')).toBe(false)
|
||||||
expect(hasStateColumn('拖到完成列了')).toBe(false)
|
expect(hasStateColumn('拖到完成列了')).toBe(false)
|
||||||
expect(hasStateColumn('')).toBe(false)
|
expect(hasStateColumn('')).toBe(false)
|
||||||
@@ -416,7 +416,7 @@ describe('hasStateColumn', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('json 数组不算 state 评论', async () => {
|
it('json 数组不算 state 评论', async () => {
|
||||||
const { hasStateColumn } = await import('../../src/gitea/stateJson')
|
const { hasStateColumn } = await import('../../src/gitea/stateJson.js')
|
||||||
expect(hasStateColumn('[{"column":"done"}]')).toBe(false)
|
expect(hasStateColumn('[{"column":"done"}]')).toBe(false)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Reference in new issue
Block a user