metarhia / metatests

Extremely simple to use test framework and runner for Metarhia technology stack 🧪
https://metarhia.com
Other
18 stars 4 forks source link

Add cli with node and browser support #75

Closed SemenchenkoVitaliy closed 6 years ago

SemenchenkoVitaliy commented 6 years ago

Closes: https://github.com/metarhia/metatests/issues/74

SemenchenkoVitaliy commented 6 years ago

Some data about run can be defined in config file 'test/config.metatests'. Example:

{
    "logLevel": "disable",
    "browsers": [
      "Chrome",
      "Firefox"
    ],
    "port": 9876,
    "simultaniousBrowserNumber": 0
}

were:

To make browser tests work common.js should be changed.

.map(path => './lib/' + path).map(require);

should be replaced with

.map(path => require('./lib/' + path));

because karma-webpack handles dynamic 'require' by parsing files and preloading packages;

Also, @lundibundi, while you are refactoring metatests, can you, please specify explicitly process.exit whenever you finish testing? Something like

process.exit(!successed);

instead of

if (!successed) process.exit(1);
lundibundi commented 6 years ago

Blocking before https://github.com/metarhia/metatests/pull/79.

lundibundi commented 6 years ago

ping @SemenchenkoVitaliy.

SemenchenkoVitaliy commented 6 years ago

I think lib/walk.js should be deleted because cli don't use it anymore. Also, if tests for metatests will run in browser, a separate folder or file with tests should be created which will exclude tests/exit-code.js since child_process can't be required in browser. @nechaido @lundibundi WDYT?

nechaido commented 6 years ago

@SemenchenkoVitaliy it may be a good idea to add an ability ignore files based on a path or regexp.

lundibundi commented 6 years ago

I think lib/walk.js can be removed, your functionality completely covers what it was doing. I think it was supposed to be used for cli but even if we do need it, it should be placed in metarhia-common, not here.

SemenchenkoVitaliy commented 6 years ago

Blocking before common v0.0.33.

tshemsedinov commented 6 years ago

Common v 0.0.33 released

lundibundi commented 6 years ago

@SemenchenkoVitaliy is this finished and can be landed?

belochub commented 6 years ago

Landed in https://github.com/metarhia/metatests/commit/ec532d6ca5fe0c65a09f4b1fb3910bb79a6d17de.