27 Commits

Author SHA1 Message Date
Kristjan ESPERANTO
7098f1e41f
Enable and apply ESLint Jest rules (#3270)
Jest was in the plugin array of the ESLint configuration, but no rules
were enabled. So ESLint hasn't checked any Jest rules yet.

So I activated the recommended Jest rules and added a few more. Then I
fixed the issues (mostly automatically). I have deactivated the rules
"jest/expect-expect" and "jest/no-done-callback" for the time being, as
they would have entailed major changes. I didn't want to make the PR too
big.

I'm not a Jest expert, but the changes so far look good to me. What do
you think of that @khassel? 🙂
2023-11-20 20:11:41 +01:00
buxxi
f25abfd2f8
Make the e2e tests wait for the app to start and close before running next test (#2952)
When trying to debug why the tests broke for
https://github.com/MichMich/MagicMirror/pull/2946 I found that the tests
does not wait for the app to start and close. So if the startup isn't
blocking that would fail.

So I added a callback for `close()` too and converted them to promises
for the `startApplication()` and `stopApplication()` and updated all the
e2e tests to await both. Will try to refactor all these callbacks to
promises in a later PR.
2022-10-29 22:34:17 +02:00
Veeck
a328ce537f
Cleanup test directory (#2937)
Moves files around and renames some so that the structure is cleaner and
more consistent
2022-10-07 12:16:37 -05:00
Karsten Hassel
f04d578704
improve tests (#2923)
use es6 syntax in all tests, split weather tests, remove callbacks
2022-10-04 10:15:24 +02:00
Karsten Hassel
fb96cc3c72 fix e2e tests not failing on errors, disable recurring-event-tests of calendar 2022-09-21 00:28:43 +02:00
Karsten Hassel
0023c64d59 use internal fetch function of node instead external node-fetch library if node version >= v18 2022-05-27 19:46:28 +02:00
Karsten Hassel
2cfafe7bfe improve waitForElement 2022-01-13 21:52:47 +01:00
Karsten Hassel
a4a8504558 update module clock 2021-09-26 22:02:29 +02:00
Karsten Hassel
e0906f3462 update module helloworld 2021-09-25 23:52:38 +02:00
Karsten Hassel
974de179e0 refactor tests in 3 categories unit, e2e and electron 2021-09-13 23:07:34 +02:00
Karsten Hassel
e3a5bbf661 use expect where missing 2021-06-14 21:07:38 +02:00
karsten13
1a244726aa run prettier 2021-06-11 22:24:21 +02:00
Karsten Hassel
b26270bd13 fix helloworld_spec tests 2021-06-11 00:36:53 +02:00
Karsten Hassel
65a8cb9ddb remove unused references 2021-06-11 00:32:54 +02:00
Karsten Hassel
0e14d3d6e8 snapshot e2e 2021-06-09 00:19:43 +02:00
Karsten Hassel
67011c0c32 snapshot e2e 2021-06-08 00:47:40 +02:00
rejas
0b3964c827 Use es6 notation in helloworld tests 2021-04-17 16:29:38 +02:00
Karsten Hassel
059b87bbb4 bump electron to v11 2021-01-30 21:58:49 +01:00
Veeck
abb5dc5739 Run prettier over ALL files once
No other changes done in this commit
2020-05-11 22:22:32 +02:00
rejas
702b98f510 Cleanup imports 2019-06-04 10:43:06 +02:00
Rodrigo Ramírez Norambuena
a6ee20fca4 Merge remote-tracking branch 'roramirez_github/develop' into default-hello-world 2017-08-20 22:49:13 -03:00
Bas van Wetten
203e1cc9b9 Implemented requested change PR #2
Moved tests/e2e_new to tests/e2e folder
2017-07-24 22:08:12 +02:00
Rodrigo Ramírez Norambuena
daad8bca69 Add test e2e helloworld module with default config text. 2017-03-26 17:36:45 -03:00
Rodrigo Ramírez Norambuena
3773d40201 Refactoring some e2e tests. Now is use a global-setup instead of
repeat repeat code to setup tests enviroment.
2017-02-19 21:06:38 -03:00
Rodrigo Ramírez Norambuena
e62df3b3b1 Increment timeout e2e test to 20000 ms 2017-02-12 15:42:00 -03:00
Rodrigo Ramírez Norambuena
aeb3ccaf09 Remove extra spaces and lines in tests. 2017-01-31 17:02:18 -03:00
Sergey Morozov
86fdd91597 Restructured Test Suite
- separated tests into e2e and unit directories
- created configs directory structure to support test framework
- added/modified `npm run test`, `npm run test:unit` and `npm run test:e2e` to target all, unit and e2e tests respectively
- modified some of the test names to be more descriptive

New structure of the Test Suite has following directory tree:

```
tests
├── configs
│   ├── env.js
│   └── modules
│       ├── clock
│       │   ├── clock_12hr.js
│       │   ├── clock_24hr.js
│       │   └── clock_showPeriodUpper.js
│       └── helloworld
│           └── helloworld.js
├── e2e
│   ├── env_spec.js
│   └── modules
│       ├── clock_spec.js
│       └── helloworld_spec.js
└── unit
    ├── functions
    │   └── cmp_versions_spec.js
    └── global_vars
        └── root_path_spec.js
```
2017-01-31 11:08:53 -08:00