-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Print watch mode shortcut commands #1555
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
Changes from all commits
7587b3b
81aed1c
502ff4f
6de3a6e
c90b54a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
'use strict'; | ||
const nodePath = require('path'); | ||
const chalk = require('chalk'); | ||
const debug = require('debug')('ava:watcher'); | ||
const diff = require('lodash.difference'); | ||
const chokidar = require('chokidar'); | ||
|
@@ -18,6 +19,7 @@ function rethrowAsync(err) { | |
|
||
const MIN_DEBOUNCE_DELAY = 10; | ||
const INITIAL_DEBOUNCE_DELAY = 100; | ||
const rerunMessage = chalk.gray.dim(`To rerun all tests, type 'r', followed by Enter\nTo update snapshots used in the previous tests, type 'u', followed by Enter\n`); | ||
|
||
class Debouncer { | ||
constructor(watcher) { | ||
|
@@ -126,6 +128,7 @@ class Watcher { | |
.then(runStatus => { | ||
runStatus.previousFailCount = this.sumPreviousFailures(currentVector); | ||
logger.finish(runStatus); | ||
logger.write(rerunMessage); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately this doesn't work with the mini reporter. I think |
||
|
||
const badCounts = runStatus.failCount + runStatus.rejectionCount + runStatus.exceptionCount; | ||
this.clearLogOnNextRun = this.clearLogOnNextRun && badCounts === 0; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,7 +325,9 @@ test('watcher does not rerun test files when they write snapshot files', t => { | |
killed = true; | ||
}, 500); | ||
} else if (passedFirst && !killed) { | ||
t.is(buffer.replace(/\s/g, ''), ''); | ||
const rerunMessage = `To rerun all tests, type 'r', followed by Enter\nTo update snapshots used in the previous tests, type 'u', followed by Enter\n`; | ||
const rerunMessageWithoutWhitespace = rerunMessage.replace(/\s/g, ''); | ||
t.is(buffer.replace(/\s/g, ''), rerunMessageWithoutWhitespace); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @novemberborn I'm not sure if what I did (asserting this) is the right way to do this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most tests use |
||
} | ||
}); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this in my terminal I think this should just be
chalk.gray
. But we then should also update the timestamp output in the mini & verbose loggers to not be dimmed.