Skip to content

Commit

Permalink
✅ Issue #3: update tests with mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed Nov 10, 2017
1 parent 0ffe828 commit a8b1d2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions spec/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* globals require, describe, it, expect */
/* globals require, describe, it, expect, spyOn */

/*!
* Module dependencies.
Expand All @@ -8,7 +8,7 @@ var cordova = require('./helper/cordova');
var mediaDevices = require('../www/mediadevices');
var MediaStream = require('../www/mediastream');

var mockStream = { id: 'ack' };
var mockStream = { id: 'ack', audioTracks: [], videoTracks: [] };

/*!
* Specification.
Expand Down Expand Up @@ -40,10 +40,13 @@ describe('phonegap-plugin-media-stream', function () {
expect(stream.active).toEqual(false);
expect(stream.getAudioTracks).toBeDefined();
expect(typeof stream.getAudioTracks).toBe('function');
expect(stream.getAudioTracks().length).toBe(0);
expect(stream.getVideoTracks).toBeDefined();
expect(typeof stream.getVideoTracks).toBe('function');
expect(stream.getVideoTracks().length).toBe(0);
expect(stream.getTracks).toBeDefined();
expect(typeof stream.getTracks).toBe('function');
expect(stream.getTracks().length).toBe(0);
expect(stream.getTrackById).toBeDefined();
expect(typeof stream.getTrackById).toBe('function');
expect(stream.addTrack).toBeDefined();
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports.defineAutoTests = function () {

});

it('getSupportedConstraints should return a promise with attributes', function () {
it('getSupportedConstraints should return a MediaTrackSupportedConstraints object', function () {

var support = navigator.mediaDevices.getSupportedConstraints();
expect(support.width).toBeDefined();
Expand Down

0 comments on commit a8b1d2c

Please sign in to comment.