Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

FIle watching not working with custom test file #314

Closed
m4nuC opened this Issue · 8 comments

6 participants

@m4nuC

Is it possible to have testem watch my source file when using a custom test runner page? I have tried adding them to scr_files but no luck.

@airportyh
Owner

It should work even if you don't have a src_files declaration. See https://github.com/airportyh/testem/tree/master/examples/jasmine_custom.

Could you post a gist that demonstrates the problem? Then I can help you debug.

@m4nuC

Thanks i'd appreciate your input, here is my current test folder https://github.com/m4nuC/zLib/blob/master/tests/.

@okonet

I also confirm that watcher doesn't trigger test runner restart. Here is my testem.json

{
  "test_page": "spec/index.mustache",
  "before_tests": "grunt before_tests",
  "serve_files": ["tmp/spec/**/*.js"],
  "watch_files": [
    "app/**!(components)/*.coffee",
    "spec/**/*.coffee"
  ],
  "launch_in_dev": ["PhantomJS"],
  "launch_in_ci": ["PhantomJS"]
}

I use coffee script in my project so it took me some time to realize that I've to use a custom grunt task which compiles specs before running the suit. But it has been working on 0.5.x quite fine. After upgrade to 0.6.1 it doesn't triggers the runner restart after I edit coffee source files.

@cavneb

:bump:

@airportyh
Owner

It must be this line https://github.com/airportyh/testem/blob/master/lib/dev/index.js#L165 where it is preventing the newly requested files from being watched. The rationale being that if you are specifying "serve_files", you don't want trigger retest when the .js files - which are generated - change, which could cause glitchy multiple firing effects. I don't understand your exact use case though. Can I see perhaps a runnable gist? Or at least the source of the custom test page.

@rwjblue

I put together a simple static file repo that demonstrates the problem:

https://github.com/rjackson/testem-reload-failure

@airportyh - It seems like this is supposed to be working. Am I doing something wrong here?

@rwjblue rwjblue referenced this issue in ember-cli/ember-cli
Merged

Use new `tmp/output` location for Testem. #463

@airportyh
Owner

@rjackson here's a fix to your example here rwjblue/testem-reload-failure#1. You've simply included testem's client-side script with the wrong path.

@airportyh
Owner

Anyone else with this problem who would like to chime in? Otherwise I will close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.