Skip to content

Commit

Permalink
updated ignore file
Browse files Browse the repository at this point in the history
Co-authored-by: Priyansh Garg <39924567+garg3133@users.noreply.github.com>
  • Loading branch information
beatfactor and garg3133 committed Nov 15, 2022
1 parent 0e00adb commit a992c9f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ lib/
.idea
tests_output/
test_output/
nightwatch.conf.js
nightwatch/
chromedriver-mobile/
logs/
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"chromedriver": "^107.0.3",
"eslint": "^8.27.0",
"mocha": "^10.1.0",
"mockery": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const CONFIG_INTRO = `===============================
Nightwatch Configuration Wizard
===============================
Initializing a new project in %s...
Initializing project in %s...
`;

export const AVAILABLE_CONFIG_FLAGS = ['yes', 'generate-config', 'browser', 'y', 'b', 'mobile'];
Expand Down Expand Up @@ -99,7 +99,7 @@ export const QUESTIONAIRRE: inquirer.QuestionCollection = [
message: 'Select target browsers',
choices: (answers) => {
let browsers = BROWSER_CHOICES;
if (answers.backend === 'local' && process.platform !== 'darwin') {
if (process.platform !== 'darwin') {
browsers = browsers.filter((browser) => browser.value !== 'safari');
}

Expand Down
28 changes: 14 additions & 14 deletions test/e2e_tests/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const nock = require('nock');

const rootDir = path.join(process.cwd(), 'test_output');

function mockLoger(consoleOutput) {
function mockLogger(consoleOutput) {
mockery.registerMock(
'./logger',
class {
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('e2e tests for init', function () {

it('with js-nightwatch-local', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -214,7 +214,7 @@ describe('e2e tests for init', function () {

it('with js-cucumber-remote', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('e2e tests for init', function () {

it('with js-mocha-both', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -520,7 +520,7 @@ describe('e2e tests for init', function () {

it('with ts-nightwatch-remote-mobile', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -673,7 +673,7 @@ describe('e2e tests for init', function () {

it('with ts-mocha-both-browserstack-mobile and non-default config', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -917,7 +917,7 @@ describe('e2e tests for init', function () {

it('with yes and browser flag', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -1057,7 +1057,7 @@ describe('e2e tests for init', function () {

it('with yes, browser and mobile flag', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -1257,7 +1257,7 @@ describe('e2e tests for init', function () {

it('generate-config with js-nightwatch-local and seleniumServer false', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -1382,7 +1382,7 @@ describe('e2e tests for init', function () {

it('generate-config with ts-nightwatch-both', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -1504,7 +1504,7 @@ describe('e2e tests for init', function () {

it('make sure we send analytics data if allowAnalytics is set to true', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand Down Expand Up @@ -1548,7 +1548,7 @@ describe('e2e tests for init', function () {
value: []
};
});

const {NightwatchInit} = require('../../lib/init');
const nightwatchInit = new NightwatchInit(rootDir, {'generate-config': true});

Expand All @@ -1575,7 +1575,7 @@ describe('e2e tests for init', function () {

it('make sure we do not send analytics data if allowAnalytics is set to false', async function () {
const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

const commandsExecuted = [];
mockery.registerMock('child_process', {
Expand All @@ -1601,7 +1601,7 @@ describe('e2e tests for init', function () {
.reply(204, (uri, requestBody) => {
assert.fail();
});

const {NightwatchInit} = require('../../lib/init');
const nightwatchInit = new NightwatchInit(rootDir, {'generate-config': true});

Expand Down
12 changes: 6 additions & 6 deletions test/unit_tests/testIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const nock = require('nock');

const VERSION = process.env.npm_package_version;

function mockLoger(consoleOutput) {
function mockLogger(consoleOutput) {
mockery.registerMock(
'./logger',
class {
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('index tests', function () {
latest: VERSION
}
});

});

afterEach( function () {
Expand All @@ -46,12 +46,12 @@ describe('index tests', function () {
nock.cleanAll();
nock.restore();
});

it('should not give suggestion when right args are passed ', async function () {
process.argv = ['node', 'filename.js', '--browser=chrome', '--browser=safari', 'args'];

const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

mockery.registerMock('node:fs', {
existsSync() {
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('index tests', function () {
process.argv = ['node', 'filename.js', '--browsers=chrome', '--browsers=safari'];

const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

mockery.registerMock('node:fs', {
existsSync() {
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('index tests', function () {
process.argv = ['node', 'filename.js', '--browser=chrome', '--browser=safari', 'args'];

const consoleOutput = [];
mockLoger(consoleOutput);
mockLogger(consoleOutput);

mockery.registerMock('node:fs', {
existsSync() {
Expand Down

0 comments on commit a992c9f

Please sign in to comment.