question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem when watching files with custom command

See original GitHub issue

Testem in development mode performs unexpected behavior when I use watch_files (runs twice and exists)

testem.json

{
  "watch_files": [
    "./lib/*",
    "./lib/**/*",
    "./tests/*",
    "./tests/**/*"
  ],
  "launchers": {
    "Node1": {
      "command": "mocha -R tap tests/* tests/**/*",
      "protocol": "tap"
    },
    "Node2": {
      "command": "mocha -R tap tests/* tests/**/*",
      "protocol": "tap"
    }
  },
  "launch_in_dev": [ "Node1", "Node2" ],
  "launch_in_ci": [ "Node1", "Node2" ]
}

Folders structure:

lib folder

lib
├── code
│   └── code.js
└── hello.js

tests folder

tests
├── code
│   └── tests.js
└── tests.js

tests.js looks like this:

ar assert = require('assert');
var hello = require('../lib/hello');

describe('hello', function(){
    it('says hello world', function(done){
        assert.equal(hello(), 'hello world');
        setTimeout(done, 400);
    });
    it('says hello to person', function(done){
        assert.equal(hello('Bob'), 'hello Bob');
        setTimeout(done, 400);
    });
});

Here is how it works (process stops automatically, I don’t do anything) testem

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
Vanuancommented, May 7, 2016

It might be worth to fork https://github.com/airportyh/fireworm/

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack custom command on watched files change
You'd want to watch your generated files. Whenever any of the two files changes, it will execute the command.
Read more >
Invoke custom command working only first time #892 - GitHub
I set a Windows batch custom command to move and rename the reference files as the duplicate files, with the option Recreate absolute...
Read more >
How to automatically watch for file changes and perform a ...
Now make sure that the file /private/var/radmind/client/.radmindOnDemand does exist. Then load the launchagent with command $ launchctl load ~/ ...
Read more >
File / Application association using a custom command is gone?
Extending this idea, try creating .desktop files for the mimeopen -a and mimeopen -d commands. This restores the ability to open via a...
Read more >
Custom Windows right-click command doesn't execute batch ...
I'm trying to create a custom right-click command which will move a file to a folder. I have a batch file called C:MyMove.bat...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found