Download tests/reader/tts-client-missing-panel.test.cjs from VoiceOfML/Search: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/tests/reader/tts-client-missing-panel.test.cjs
- Command line
-
hf download hf://spaces/VoiceOfML/Search/tests/reader/tts-client-missing-panel.test.cjs
-
curl -L -o tts-client-missing-panel.test.cjs https://huggingface.co/spaces/VoiceOfML/Search/resolve/main/tests/reader/tts-client-missing-panel.test.cjs
643 Bytes
| const test = require('node:test'); | |
| const assert = require('node:assert/strict'); | |
| const fs = require('node:fs'); | |
| const path = require('node:path'); | |
| const vm = require('node:vm'); | |
| test('a cached shell without the speech panel keeps the planner and disables the player', () => { | |
| const source = fs.readFileSync(path.join(__dirname, '../../static/tts-client.js'), 'utf8'); | |
| const document = { querySelector: () => null }; | |
| const context = vm.createContext({ document, window: {}, Intl }); | |
| vm.runInContext(source, context); | |
| assert.equal(context.window.CCRDSpeech, null); | |
| assert.equal(typeof context.CCRDSpeechPlan.batch, 'function'); | |
| }); | |