When I run jest, I don't see the green progress bar or any of the live printout data in my terminal.
The Test Suites, Tests, Snapshots, and Time stats are only printed out after all my tests are complete. Until tests are complete, the only indicator I see is:
RUNS path/to/tests
There's no way for me to tell whether the tests have stalled or are still running until the entire suite is complete.
I am running jest with puppeteer for end to end testing.
yarn installyarn test (I set up jest global setup/teardown scripts to handle starting the server)import puppeteer from 'puppeteer';
describe('a basic react app that puppeteer can automate', () => {
let browser;
let page;
beforeAll(async () => {
browser = await puppeteer.launch({ slowMo: 250 });
page = await browser.newPage();
});
afterAll(async () => {
await browser.close();
})
it('opens the home page', async () => {
await page.goto('http://localhost:3000');
expect(await page.url()).toBe('http://localhost:3000/');
})
it('has app header', async () => {
expect(await page.$('.App-header')).not.toBe(null);
})
it('has logo', async () => {
expect(await page.$('img[src="/static/media/logo.5d5d9eef.svg"]')).not.toBe(null);
})
it('should have a Learn React link that opens a new page', async () => {
await page.click('.App-link');
expect(await page.url()).toBe('https://reactjs.org/')
})
})
import spawnd from 'spawnd';
import cwd from 'cwd';
import http from 'http';
function serverReady() {
return new Promise(function(resolve) {
async function checkReady() {
const req = http.get({
hostname: 'localhost',
port: 3000,
path: '/',
}, function (res) {
if (res.statusCode === 200) {
resolve();
} else {
return checkReady();
}
});
req.on('error', function() {
return checkReady();
});
}
checkReady();
});
}
export default async function setup() {
console.log(`\nStarting up react server at port 3000...`);
const server = spawnd('yarn', ['start'], { shell: true, cwd: cwd() });
global.server = server;
await serverReady();
console.log('\nServer Ready');
}
I expected my jest tests to show progress bar and live stats printouts like this:

https://github.com/jeremygottfried/test-jest-cli
System:
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 13.6.0 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
npmPackages:
jest: ^24.9.0 => 24.9.0
$ [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
# => Interactive
shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'
# => Login shell
This is due to you having only a single test meaning jest will the test run in band (meaning within the same process as the jest process), in which case we don't show the status bar until tests complete. This is on purpose, see discussion in #1782 and PR #1813. Relevant code is here:
However, forcing the flag to be true works correctly for me - the summary is updated as the tests run. It's probably due to your tests being async, so we're able to update, while synchronous tests would lock up the process and we wouldn't be able to update the status.
Not sure what, if anything, to do here. @thymikee @jeysal @cpojer thoughts? If we don't wanna change any code we should probably document it somewhere.
@jeremygottfried in your case you can just add a second test file and the summary will appear
is this issue the same of https://github.com/facebook/jest/issues/6616 ?
i have the same issue as @jeremygottfried reported,
in order to find a workaroud,
i'm splitting the testsuite creationg a .test.js file for every single test, or almost for longer.
because runner update itself every test suite,
and if a test suite contains a single test,
it update every test.
logically this needs to replicate a lot of codes,
and i would like to obtain update every test, not every test suite.
Not related to #6616, no. Your issue is #6616 though
Thanks @SimenB , that worked for showing the live stats and progress bar.
I agree it would be helpful to document what enables the live stats and progress bar. If the time estimate is long for a single test suite, maybe show it by default? My test suite takes around 4 minutes, which is quite a while to see RUNS path/to/my/test and nothing else.