Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Commit 6843b7d

Browse files
committed
test(e2e): Adapt all e2e tests
1 parent 0e15f97 commit 6843b7d

32 files changed

Lines changed: 169 additions & 284 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# tests
1010
/coverage
1111
/mocks
12-
/test/e2e/main/fixtures/files-watch
12+
/test/e2e/main/v1/fixtures/files-watch
13+
/test/e2e/main/v1/fixtures/mocks.config.js
1314

1415
# misc
1516
.DS_Store

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
This plugin is preinstalled in the [main distribution of the Mocks Server project][main-distribution-url]. _If you want ot install it by yourself, you can refer to the [plugins documentation][plugins-url]._
1515

16-
![Interactive CLI](assets/cli_animation.gif)
16+
![Interactive CLI][animated-image-url]
1717

1818
## Main features
1919

@@ -24,7 +24,7 @@ This plugin is preinstalled in the [main distribution of the Mocks Server projec
2424

2525
## Options
2626

27-
* `cli`: `<String>` Start interactive CLI or not. Default is `true`. Use `false` to disable it.
27+
* `cli`: `<String>` Start interactive CLI or not. Default is `true`. Use `false` to disable it _(`--no-cli`) when using command line arguments)_
2828

2929
## Support
3030

jest.e2e.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
clearMocks: true,
77

88
testMatch: ["<rootDir>/test/e2e/**/*.spec.js"],
9-
testMatch: ["<rootDir>/test/e2e/inquirer/*.spec.js"],
9+
// testMatch: ["<rootDir>/test/e2e/main/v1/web-tutorial-files-watch.spec.js"],
1010

1111
// Indicates whether the coverage information should be collected while executing the test
1212
collectCoverage: false,

src/Cli.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@ class Cli {
163163
this._started = true;
164164
if (this._stopListeningChangeMocks) {
165165
this._stopListeningChangeMocks();
166+
this._stopListeningChangeLegacyMocks();
166167
this._stopListeningChangeAlerts();
167168
}
168169
this._stopListeningChangeAlerts = this._core.onChangeAlerts(this._onChangeAlerts);
169170
this._stopListeningChangeMocks = this._core.onChangeMocks(this._onChangeMocks);
171+
this._stopListeningChangeLegacyMocks = this._core.onChangeLegacyMocks(this._onChangeMocks);
170172
this._logLevel = this._settings.get("log");
171173
this._silentTraces();
172174
this._displayMainMenu();
@@ -179,6 +181,7 @@ class Cli {
179181
}
180182
this._started = false;
181183
this._stopListeningChangeMocks();
184+
this._stopListeningChangeLegacyMocks();
182185
this._stopListeningChangeAlerts();
183186
this._settings.set("log", this._logLevel);
184187
this._cli.logsMode();

test/e2e/inquirer/autocomplete.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
1111

1212
const path = require("path");
1313

14-
const CliRunner = require("../support/CliRunner");
14+
const CliRunner = require("./support/CliRunner");
1515

1616
const END_SCREEN = "Exit";
1717

test/e2e/inquirer/exit-logs-mode.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
1111

1212
const path = require("path");
1313

14-
const CliRunner = require("../support/CliRunner");
14+
const CliRunner = require("./support/CliRunner");
1515

1616
const END_SCREEN = "Exit";
1717

test/e2e/inquirer/logs-mode.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
1111

1212
const path = require("path");
1313

14-
const CliRunner = require("../support/CliRunner");
14+
const CliRunner = require("./support/CliRunner");
1515

1616
const END_SCREEN = "Exit";
1717

test/e2e/inquirer/readme-example.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
1111

1212
const path = require("path");
1313

14-
const CliRunner = require("../support/CliRunner");
14+
const CliRunner = require("./support/CliRunner");
1515

1616
const END_SCREEN = "Exit";
1717

test/e2e/inquirer/remove-listeners.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Unless required by applicable law or agreed to in writing, software distributed
1111

1212
const path = require("path");
1313

14-
const CliRunner = require("../support/CliRunner");
14+
const CliRunner = require("./support/CliRunner");
1515

1616
const END_SCREEN = "Exit";
1717

0 commit comments

Comments
 (0)