Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngMock - 1.5.0-beta.2 - Error: [ng:areq] Argument 'fn' is not a function, got string #13397

Closed
@albertosantini

Description

@albertosantini

Upgrading to 1.5.0-beta.2 from 1.4.8 I get the following exception:

Error: [ng:areq] Argument 'fn' is not a function, got string
http://errors.angularjs.org/1.5.0-beta.2/ng/areq?p0=fn&p1=not%20a%20function%2C%20got%20string
    at https://code.angularjs.org/1.5.0-beta.2/angular.js:68:12
    at assertArg (https://code.angularjs.org/1.5.0-beta.2/angular.js:1810:11)
    at assertArgFn (https://code.angularjs.org/1.5.0-beta.2/angular.js:1820:3)
    at Function.annotate (https://code.angularjs.org/1.5.0-beta.2/angular.js:3930:5)
    at Function.angular.injector.$$annotate (https://code.angularjs.org/1.5.0-beta.2/angular-mocks.js:2461:36)
    at Object.invoke (https://code.angularjs.org/1.5.0-beta.2/angular.js:4626:36)
    at https://code.angularjs.org/1.5.0-beta.2/angular-mocks.js:2544:43
    at Object.forEach (https://code.angularjs.org/1.5.0-beta.2/angular.js:340:20)
    at workFn (https://code.angularjs.org/1.5.0-beta.2/angular-mocks.js:2533:17)
    at window.module.angular.mock.module (https://code.angularjs.org/1.5.0-beta.2/angular-mocks.js:2526:30)

It seems related to the module definition: beforeEach(module("app"));

I reproduced the issue in this plunker (with 1.4.8 is ok):
http://plnkr.co/edit/Y1zGI2rlbCVVDLFRT1mO?p=preview

Weirdly removing a spec, there are two equal specs loaded in index.html, the test is ok.

Project reference: https://github.com/albertosantini/argo
You can change karma.conf accordingly setting 1.5.0-beta.2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions