jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

Global variable store is overwritten #253

Closed eugene-ku closed 9 years ago

eugene-ku commented 10 years ago

Hello! This is a complex bug which: I have a script which setup a global 'store' variable and it's working fine untile FileSaver.js is included, then it became undefined. This is only in teaspoon environment. Any ideas?

jejacks0n commented 10 years ago

Maybe something to do with load order? Take the head tags from both teaspoon and otherwise and confirm the script tags are the same.

Then look into whatever framework you're using to make sure it's not clobbering it.

An alternate is that phantomjs doesn't support whatever feature you're using and you haven't diagnosed it properly.


Jeremy Jackson

On Jul 28, 2014, at 6:56 AM, eugene-ku notifications@github.com wrote:

Hello! This is a complex bug which: I have a script which setup a global 'store' variable and it's working fine untile FileSaver.js is included, then it became undefined. This is only in teaspoon environment. Any ideas?

— Reply to this email directly or view it on GitHub.

eugene-ku commented 10 years ago

1) all the scripts are located in application.js.coffee and are loaded from <%= javascript_include_tag *@suite.spec_assets %>, so order is preserved

2) everything is fine outside teaspoon environment, so framework can be involved but in a very subtle way.

can you give some tips for debugging?

jejacks0n commented 10 years ago

I said to check the output. There were bugs in rails and I want to make sure that's not it.

Does it work in the browser when running the tests?


Jeremy Jackson

On Jul 29, 2014, at 4:22 AM, eugene-ku notifications@github.com wrote:

1) all the scripts are located in application.js.coffee and are loaded from <%= javascript_include_tag *@suite.spec_assets %>, so order is preserved

2) everything is fine outside teaspoon environment, so framework can be involved but in a very subtle way.

can you give some tips for debugging?

— Reply to this email directly or view it on GitHub.

eugene-ku commented 10 years ago

There are no errors in the console and there is a global error when running tests

zorbash commented 9 years ago

@eugene-ku have you solved your problem?

mikepack commented 9 years ago

Closing. Would happily accept a PR or jsbin reproducing the problem.