Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is an error when I call the method spyon & andCallFake #26

Closed
NewGyu opened this issue Sep 11, 2014 · 1 comment
Closed

It is an error when I call the method spyon & andCallFake #26

NewGyu opened this issue Sep 11, 2014 · 1 comment

Comments

@NewGyu
Copy link

NewGyu commented Sep 11, 2014

The success when using jasmine-node command

PC4762:jasmine newgyu$ jasmine-node test/ExampleSpec.js
..

Finished in 0.007 seconds
2 tests, 2 assertions, 0 failures, 0 skipped

But, it fails when using gulp-jasmine

PC4762:jasmine newgyu$ gulp test
[21:00:04] Using gulpfile ~/temp/jasmine/gulpfile.js
[21:00:04] Starting 'test'...
[21:00:04] Finished 'test' after 15 ms
Running 2 specs.

example
    use spy: failed
    unuse spy: passed

Failures:
1) example use spy
1.1) TypeError: undefined is not a function
    TypeError: undefined is not a function
        at Object.<anonymous> (/Users/newgyu/temp/jasmine/test/ExampleSpec.js:6:26)

2 specs, 1 failure
Finished in 0.004 seconds

Sample Code: https://gist.github.com/NewGyu/64ddef2561fdee2b63af

@NewGyu
Copy link
Author

NewGyu commented Sep 11, 2014

Sorry! I had been a misunderstanding. My test code is wrong.

jasmine-node is compatible jasmine1.3. But,gulp-jasmine is compatible jasmine2.x. (minijasminenode that is dependent on gulp-jasmine is compatible jasmine2)

How to write callFake has been changed from jasmine2, I should have been written as follows.

spyOn(str1,'indexOf').and.callFake(function(s){
    return 50;
});

@NewGyu NewGyu closed this as completed Sep 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant