|
18 | 18 | 'use strict';
|
19 | 19 |
|
20 | 20 | const path = require(`path`);
|
21 |
| -const test = require(`ava`); |
| 21 | +const assert = require(`assert`); |
22 | 22 |
|
23 | 23 | const {runAsync} = require(`@google-cloud/nodejs-repo-tools`);
|
24 | 24 |
|
@@ -48,63 +48,77 @@ const multiUri = `gs://nodejs-docs-samples/multi_mono.wav`;
|
48 | 48 | const brooklynUri = `gs://cloud-samples-tests/speech/brooklyn.flac`;
|
49 | 49 | const stereoUri = `gs://cloud-samples-tests/speech/commercial_stereo.wav`;
|
50 | 50 |
|
51 |
| -test(`should run speech diarization on a local file`, async t => { |
52 |
| - const output = await runAsync(`${cmd} Diarization -f ${monoFilePath}`, cwd); |
53 |
| - t.true(output.includes(`speakerTag: 1`) && output.includes(`speakerTag: 2`)); |
54 |
| -}); |
55 |
| - |
56 |
| -test(`should run speech diarization on a GCS file`, async t => { |
57 |
| - const output = await runAsync(`${cmd} DiarizationGCS -u ${monoUri}`, cwd); |
58 |
| - t.true(output.includes(`speakerTag: 1`) && output.includes(`speakerTag: 2`)); |
59 |
| -}); |
60 |
| - |
61 |
| -test(`should run multi channel transcription on a local file`, async t => { |
62 |
| - const output = await runAsync( |
63 |
| - `${cmd} multiChannelTranscribe -f ${stereoFilePath}`, |
64 |
| - cwd |
65 |
| - ); |
66 |
| - t.true(output.includes(`Channel Tag: 2`)); |
67 |
| -}); |
68 |
| - |
69 |
| -test(`should run multi channel transcription on GCS file`, async t => { |
70 |
| - const output = await runAsync( |
71 |
| - `${cmd} multiChannelTranscribeGCS -u ${stereoUri}`, |
72 |
| - cwd |
73 |
| - ); |
74 |
| - t.true(output.includes(`Channel Tag: 2`)); |
75 |
| -}); |
76 |
| - |
77 |
| -test(`should transcribe multi-language on a local file`, async t => { |
78 |
| - const output = await runAsync( |
79 |
| - `${cmd} multiLanguageTranscribe -f ${multiLanguageFile}`, |
80 |
| - cwd |
81 |
| - ); |
82 |
| - t.true(output.includes(`Transcription: how are you doing estoy bien e tu`)); |
83 |
| -}); |
84 |
| - |
85 |
| -test(`should transcribe multi-language on a GCS bucket`, async t => { |
86 |
| - const output = await runAsync( |
87 |
| - `${cmd} multiLanguageTranscribeGCS -u ${multiUri}`, |
88 |
| - cwd |
89 |
| - ); |
90 |
| - t.true(output.includes(`Transcription: how are you doing estoy bien e tu`)); |
91 |
| -}); |
92 |
| - |
93 |
| -test(`should run word Level Confience on a local file`, async t => { |
94 |
| - const output = await runAsync( |
95 |
| - `${cmd} wordLevelConfidence -f ${BrooklynFilePath}` |
96 |
| - ); |
97 |
| - t.true(output.includes(`Transcription: how old is the Brooklyn Bridge`)); |
98 |
| - t.true(/Confidence: \d\.\d/.test(output)); |
99 |
| -}); |
100 |
| - |
101 |
| -test(`should run word level confidence on a GCS bucket`, async t => { |
102 |
| - const output = await runAsync( |
103 |
| - `${cmd} wordLevelConfidenceGCS -u ${brooklynUri}`, |
104 |
| - cwd |
105 |
| - ); |
106 |
| - t.true( |
107 |
| - output.includes(`Transcription: how old is the Brooklyn Bridge`) && |
108 |
| - /Confidence: \d\.\d/.test(output) |
109 |
| - ); |
| 51 | +describe(`BetaFeatures`, () => { |
| 52 | + |
| 53 | + it(`should run speech diarization on a local file`, async () => { |
| 54 | + const output = await runAsync( |
| 55 | + `${cmd} Diarization -f ${monoFilePath}`, |
| 56 | + cwd |
| 57 | + ); |
| 58 | + assert.ok( |
| 59 | + output.includes(`speakerTag: 1`) && output.includes(`speakerTag: 2`) |
| 60 | + ); |
| 61 | + }); |
| 62 | + |
| 63 | + it(`should run speech diarization on a GCS file`, async () => { |
| 64 | + const output = await runAsync(`${cmd} DiarizationGCS -u ${monoUri}`, cwd); |
| 65 | + assert.ok( |
| 66 | + output.includes(`speakerTag: 1`) && output.includes(`speakerTag: 2`) |
| 67 | + ); |
| 68 | + }); |
| 69 | + |
| 70 | + it(`should run multi channel transcription on a local file`, async () => { |
| 71 | + const output = await runAsync( |
| 72 | + `${cmd} multiChannelTranscribe -f ${stereoFilePath}`, |
| 73 | + cwd |
| 74 | + ); |
| 75 | + assert.ok(output.includes(`Channel Tag: 2`)); |
| 76 | + }); |
| 77 | + |
| 78 | + it(`should run multi channel transcription on GCS file`, async () => { |
| 79 | + const output = await runAsync( |
| 80 | + `${cmd} multiChannelTranscribeGCS -u ${stereoUri}`, |
| 81 | + cwd |
| 82 | + ); |
| 83 | + assert.ok(output.includes(`Channel Tag: 2`)); |
| 84 | + }); |
| 85 | + |
| 86 | + it(`should transcribe multi-language on a local file`, async () => { |
| 87 | + const output = await runAsync( |
| 88 | + `${cmd} multiLanguageTranscribe -f ${multiLanguageFile}`, |
| 89 | + cwd |
| 90 | + ); |
| 91 | + assert.ok(output.includes(`Transcription: how are you doing estoy bien e tu`)); |
| 92 | + }); |
| 93 | + |
| 94 | + it(`should transcribe multi-language on a GCS bucket`, async () => { |
| 95 | + const output = await runAsync( |
| 96 | + `${cmd} multiLanguageTranscribeGCS -u ${multiUri}`, |
| 97 | + cwd |
| 98 | + ); |
| 99 | + assert.ok( |
| 100 | + output.includes(`Transcription: how are you doing estoy bien e tu`) |
| 101 | + ); |
| 102 | + }); |
| 103 | + |
| 104 | + it(`should run word Level Confience on a local file`, async () => { |
| 105 | + const output = await runAsync( |
| 106 | + `${cmd} wordLevelConfidence -f ${BrooklynFilePath}` |
| 107 | + ); |
| 108 | + assert.ok( |
| 109 | + output.includes(`Transcription: how old is the Brooklyn Bridge`) |
| 110 | + ); |
| 111 | + assert.ok(/Confidence: \d\.\d/.test(output)); |
| 112 | + }); |
| 113 | + |
| 114 | + it(`should run word level confidence on a GCS bucket`, async () => { |
| 115 | + const output = await runAsync( |
| 116 | + `${cmd} wordLevelConfidenceGCS -u ${brooklynUri}`, |
| 117 | + cwd |
| 118 | + ); |
| 119 | + assert.ok( |
| 120 | + output.includes(`Transcription: how old is the Brooklyn Bridge`) && |
| 121 | + /Confidence: \d\.\d/.test(output) |
| 122 | + ); |
| 123 | + }); |
110 | 124 | });
|
0 commit comments