-
Notifications
You must be signed in to change notification settings - Fork 45
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
TypeError: tty.getWindowSize is not a function #247
Comments
Hey @AntaninaKaltsova, thanks for checking the new version :) |
Same issue here, using macOS Mojave 10.14.5. Also checked with version 2.1.0 and the same thing is happening. |
@alvaroemmanuel do you also run mocha-parallel-tests programmatically (not via its CLI)? |
@1999 no, I'm running it through CLI, from |
Gotcha. I could reproduce this issue but unfortunately, it doesn't fail in the CI: #250. I will try to fix this in the next few days. |
@alvaroemmanuel @AntaninaKaltsova this issue should be resolved in |
It's working now, thanks @1999 |
Hi! I started to get the following error:
(node:53208) UnhandledPromiseRejectionWarning: TypeError: tty.getWindowSize is not a function at Object.<anonymous>
at the linetty.getWindowSize()[1];
in *\node_modules\mocha\lib\reporters\base.js lineСan еhis be related to the new version 2.2.0?
Node version: v12.4.0
My mocha-runner.ts
`require("dotenv").config();
import fs from "fs";
import Mocha from 'mocha-parallel-tests';
import path from "path";
const mocha = new Mocha({
reporter: "mocha-multi-reporters",
reporterOptions: {
configFile: "./mocha-multi-reporters.config.json",
},
timeout: 120000,
ui: "bdd",
});
const testDir = "./build/tests";
/**
Gets the test .js file paths recursively from a given directory.
@param {String} dir - path to directory containing test files.
@returns {Array} Filepaths to each test .js file.
*/
function getTestPaths(dir, fileList) {
const files = fs.readdirSync(dir);
fileList = fileList || [];
files.forEach(function (file) {
if (fs.statSync(path.join(dir, file)).isDirectory()) {
fileList = getTestPaths(path.join(dir, file), fileList);
} else {
fileList.push(path.join(dir, file));
}
});
return fileList.filter(function (file) {
return path.extname(file) === ".js";
});
}
// Get all .js paths and add each file to the mocha instance.
getTestPaths(testDir).forEach(function (file) {
mocha.addFile(path.join(file));
});
// Run the tests.
mocha.run(function (failures) {
process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures
});
`
The text was updated successfully, but these errors were encountered: