Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

testing error - addMatchers is not a function  #277

@ajlee

Description

@ajlee

I'm following the tutorial to learn how to use Angular. But I am getting this error when I try run the npm test command:

PhoneCat controllers PhoneListCtrl should create "phones" model with 2 phones fetched from xhr FAILED TypeError: this.addMatchers is not a function at Object. (/Users/alex/Sites/htdocs/angular-phonecat/test/unit/controllersSpec.js:7:10) Expected [ { name : 'Nexus S' }, { name : 'Motorola DROID' } ] to equal [ { name : 'Nexus S' }, { name : 'Motorola DROID' } ]. Error: Expected [ { name : 'Nexus S' }, { name : 'Motorola DROID' } ] to equal [ { name : 'Nexus S' }, { name : 'Motorola DROID' } ]. at Object. (/Users/alex/Sites/htdocs/angular-phonecat/test/unit/controllersSpec.js:34:28) Chrome 45.0.2454 (Mac OS X 10.11.0) PhoneCat controllers PhoneListCtrl should set the default value of orderProp model FAILED TypeError: this.addMatchers is not a function at Object. (/Users/alex/Sites/htdocs/angular-phonecat/test/unit/controllersSpec.js:7:10) Chrome 45.0.2454 (Mac OS X 10.11.0) PhoneCat controllers PhoneDetailCtrl should fetch phone detail FAILED TypeError: this.addMatchers is not a function at Object. (/Users/alex/Sites/htdocs/angular-phonecat/test/unit/controllersSpec.js:7:10) TypeError: expect(...).toEqualData is not a function at Object. (/Users/alex/Sites/htdocs/angular-phonecat/test/unit/controllersSpec.js:66:27)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions