Lines Matching refs:t
48 export async function test(t) { argument
51 const describeWithPermissions = shouldSkipTestsRequiringPermissions ? t.xdescribe : t.describe;
54 t.beforeAll(async () => {
75 t.beforeEach(async () => {
77 t.expect(status).toEqual('granted');
81 t.afterEach(() => {
85 t.describe('Recording.prepareToRecordAsync(preset)', () => {
86 t.afterEach(async () => {
92 t.it('sets high preset successfully', async () => {
96 t.it('sets low preset successfully', async () => {
100 t.it('sets custom preset successfully', async () => {
142 t.describe('Recording.setOnRecordingStatusUpdate(onRecordingStatusUpdate)', () => {
143 t.it('sets a function that gets called when status updates', async () => {
144 const onRecordingStatusUpdate = t.jasmine.createSpy('onRecordingStatusUpdate');
146 t.expect(onRecordingStatusUpdate).toHaveBeenCalledWith(
147 t.jasmine.objectContaining({ canRecord: false })
150 t.expect(onRecordingStatusUpdate).toHaveBeenCalledWith(
151 t.jasmine.objectContaining({ canRecord: true })
158 t.it('sets a function that gets called when recording finishes', async () => {
159 const onRecordingStatusUpdate = t.jasmine.createSpy('onRecordingStatusUpdate');
161 t.expect(onRecordingStatusUpdate).toHaveBeenCalledWith(
162 t.jasmine.objectContaining({ canRecord: false })
165 t.expect(onRecordingStatusUpdate).toHaveBeenCalledWith(
166 t.jasmine.objectContaining({ canRecord: true })
171 t.expect(onRecordingStatusUpdate).toHaveBeenCalledWith(
172 t.jasmine.objectContaining({ isDoneRecording: true, canRecord: false })
208 t.describe('Recording.getAvailableInputs()', () => {
209 t.afterEach(async () => {
215 t.it('returns a list of available recording inputs', async () => {
219 t.expect(inputs.length).toBeGreaterThan(0);
223 t.describe('Recording.getCurrentInput()', () => {
224 t.afterEach(async () => {
229 t.it('returns the currently-selected recording input', async () => {
233 t.expect(input).toBeDefined();
237 t.describe('Recording.setInput()', () => {
238 t.afterEach(async () => {
243 t.it('sets the recording input', async () => {
250 t.expect(currentInput.uid).toEqual(initialInput.uid);
254 t.describe('Recording.startAsync()', () => {
255 t.afterEach(async () => {
260 t.it('starts a clean recording', async () => {
267 t.it('starts a paused recording', async () => {
280 t.describe('Recording.pauseAsync()', () => {
281 t.it('pauses the recording', async () => {
293 t.describe('Recording.getURI()', () => {
294 t.it('returns null before the recording is prepared', async () => {
295 t.expect(recordingObject.getURI()).toBeNull();
298 t.it('returns a string once the recording is prepared', async () => {
304 t.expect(recordingObject.getURI()).toEqual(null);
306 t.expect(recordingObject.getURI()).toContain('file:///');
312 t.describe('Recording.createNewLoadedSound()', () => {
315 t.beforeAll(() => {
325 t.afterAll(() => {
330 t.it('fails if called before the recording is prepared', async () => {
337 t.expect(error).toBeDefined();
341 t.it('fails if called before the recording is started', async () => {
349 t.expect(error).toBeDefined();
354 t.it('fails if called before the recording is recording', async () => {
364 t.expect(error).toBeDefined();
368 t.it('returns a sound object once the recording is done', async () => {
384 t.expect(status.durationMillis).toBeGreaterThan(recordingDuration * (7 / 10));
386 t.expect(sound).toBeDefined();
390 t.expect(error).toBeNull();
398 t.it('raises an error when the recording is in an unreadable format', async () => {
412 t.expect(error).toBeDefined();
421 t.describe('Recording.createNewLoadedSoundAsync()', () => {
422 t.it('fails if called before the recording is prepared', async () => {
429 t.expect(error).toBeDefined();
433 t.it('fails if called before the recording is started', async () => {
441 t.expect(error).toBeDefined();
446 t.it('fails if called before the recording is recording', async () => {
456 t.expect(error).toBeDefined();
460 t.it('returns a sound object once the recording is done', async () => {
477 t.expect(status.durationMillis).toBeGreaterThan(recordingDuration * (6 / 10));
479 t.expect(sound).toBeDefined();
483 t.expect(error).toBeNull();
491 t.it('raises an error when the recording is in an unreadable format', async () => {
505 t.expect(error).toBeDefined();
514 t.describe('Recording.createAsync()', () => {
515 t.afterEach(async () => {
520 t.it('creates and starts recording', async () => {