-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84,220 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+2.94 KB
...ineMock/__screenshots__/index.browser.spec.ts/mock-synthesisSynthesisPost-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions
66
tests/unit/mock/engineMock/__snapshots__/index.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
||
exports[`mock > audioQueryAudioQueryPost 1`] = ` | ||
{ | ||
"accentPhrases": [ | ||
{ | ||
"accent": 5, | ||
"moras": [ | ||
{ | ||
"consonant": "k", | ||
"consonantLength": 0.0220625, | ||
"pitch": 4.7734375, | ||
"text": "コ", | ||
"vowel": "o", | ||
"vowelLength": 0.1140625, | ||
}, | ||
{ | ||
"consonant": undefined, | ||
"consonantLength": undefined, | ||
"pitch": 3.609375, | ||
"text": "ン", | ||
"vowel": "N", | ||
"vowelLength": 0.08312499999999999, | ||
}, | ||
{ | ||
"consonant": "n", | ||
"consonantLength": 0.022625, | ||
"pitch": 4.75, | ||
"text": "ニ", | ||
"vowel": "i", | ||
"vowelLength": 0.10843749999999999, | ||
}, | ||
{ | ||
"consonant": "ch", | ||
"consonantLength": 0.0400625, | ||
"pitch": 4.0234375, | ||
"text": "チ", | ||
"vowel": "i", | ||
"vowelLength": 0.10843749999999999, | ||
}, | ||
{ | ||
"consonant": "h", | ||
"consonantLength": 0.0315, | ||
"pitch": 4.796875, | ||
"text": "ハ", | ||
"vowel": "a", | ||
"vowelLength": 0.1509375, | ||
}, | ||
], | ||
"pauseMora": undefined, | ||
}, | ||
], | ||
"intonationScale": 1, | ||
"outputSamplingRate": 24000, | ||
"outputStereo": false, | ||
"pitchScale": 0, | ||
"postPhonemeLength": 0.1, | ||
"prePhonemeLength": 0.1, | ||
"speedScale": 1, | ||
"volumeScale": 1, | ||
} | ||
`; | ||
|
||
exports[`mock > synthesisSynthesisPost 1`] = `"680a0b3cb0e937d56e3f99304de0d352599439502443bae11828bf875be13bc4"`; | ||
|
||
exports[`mock > versionVersionGet 1`] = `"mock"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { hash } from "../../utils"; | ||
import { createOpenAPIEngineMock } from "@/mock/engineMock"; | ||
|
||
describe("mock", () => { | ||
const mock = createOpenAPIEngineMock(); | ||
|
||
it("versionVersionGet", async () => { | ||
const response = await mock.versionVersionGet(); | ||
expect(response).toMatchSnapshot(); | ||
}); | ||
|
||
it("audioQueryAudioQueryPost", async () => { | ||
const response = await mock.audioQueryAudioQueryPost({ | ||
text: "こんにちは", | ||
speaker: 0, | ||
}); | ||
expect(response).toMatchSnapshot(); | ||
}); | ||
|
||
it("synthesisSynthesisPost", async () => { | ||
const audioQuery = await mock.audioQueryAudioQueryPost({ | ||
text: "こんにちは", | ||
speaker: 0, | ||
}); | ||
const response = await mock.synthesisSynthesisPost({ | ||
audioQuery, | ||
speaker: 0, | ||
}); | ||
expect(await hash(await response.arrayBuffer())).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.