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

testem ci command won't work with prototype.js(1.6.3) #130

Closed
yokotaso opened this issue Dec 13, 2012 · 3 comments
Closed

testem ci command won't work with prototype.js(1.6.3) #130

yokotaso opened this issue Dec 13, 2012 · 3 comments

Comments

@yokotaso
Copy link

issues

when writing a test with prototype.js(version 1.6.3). testem version is 0.2.36

execute testem ci

result of testm ci as below:

# Launching Firefox
# 
TAP version 13
ok 1 - Firefox "undefined"

# Launching Chrome
# ..
ok 2 - Chrome undefined
ok 3 - Chrome undefined

cause of issue

The cause of this issue is that the Array.ptototype.toJSON implemented in prototype.js returns invalid JSON object. And in testem, the test result handle as a string object.

the version of prototype.js is later than 1.7, this issue does't reproduce.
see: prototypejs/prototype@038a298

I think, This issue is not a testem bug, but also not prototype.js bug.
So, I want you to add known issue of manual.

how to avoid:

  • prepare *.js file. this file overwirte Array.ptototype.toJSON

I name this file compatible.js

(function(){
    Array.prototype.toJSON = null;
})();
  • add configuration file to include compatible.js after include ptototype.js
{
    "src_files" : [ "prototype.js",   "compatible.js" ]
}

and execute testem ci. it iworks well.

@airportyh
Copy link
Collaborator

Thanks for the detailed report. I will try to make a workaround that protects against this if possible.

@airportyh
Copy link
Collaborator

Alright, given JSON.stringify is a native api, nothing can be done it seems.

@yokotaso
Copy link
Author

Thanks for adding testem manual! Thanks a lot!

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

2 participants