O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unexpected test failure

Now isn't it very interesting that one of our tests actually failed; TrackModel Creation Verify mute FAILED and Expected 1 to be 5.. This failure was not preplanned for the book; it is actually a real corner case that we just found because we started to use unit testing. If you want to take a quick look at the code, here is the TrackModel.ts code stripped down to just show the relevant routines:

export class TrackModel implements ITrack {  private _volume: number = 1; private _mute: boolean; private _origVolume: number; constructor(model?: ITrack) {   if (model) {    for (let key in model) {      this[key] = model[key];    }   }

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required