t2ym/i18n-behavior

[2.0][test] Coverage is not assessed with web-component-tester 6

t2ym opened this issue · 4 comments

t2ym commented

[2.0][test] Coverage is not assessed with web-component-tester 6

$ cp -vf test/0-wct.conf.json wct.conf.json && xvfb-run wct test/index-fake.html
`test/0-wct.conf.json' -> `wct.conf.json'
Received undefined
Windows 10 firefox       Beginning tests via http://localhost:8081/components/i18n-behavior/generated-index.html?cli_browser_id=1
Windows 10 chrome        Beginning tests via http://localhost:8081/components/i18n-behavior/generated-index.html?cli_browser_id=0
OS X 10.9 safari 7       Beginning tests via http://localhost:8081/components/i18n-behavior/generated-index.html?cli_browser_id=4
Windows 8.1 IE 11        Beginning tests via http://localhost:8081/components/i18n-behavior/generated-index.html?cli_browser_id=2
Windows 7 IE 10          Beginning tests via http://localhost:8081/components/i18n-behavior/generated-index.html?cli_browser_id=3
Windows 10 chrome        Tests passed
OS X 10.9 safari 7       Tests passed
Windows 10 firefox       Tests passed
Windows 7 IE 10          Tests passed
Windows 8.1 IE 11        Tests passed
Test run ended with great success
Windows 10 chrome (348/0/0)           
Windows 10 firefox (348/0/0)          
Windows 8.1 IE 11 (348/0/0)           
Windows 7 IE 10 (348/0/0)             
OS X 10.9 safari 7 (348/0/0)          
=============================== Coverage summary ===============================
Statements   : 100% ( 0/0 )
Branches     : 100% ( 0/0 )
Functions    : 100% ( 0/0 )
Lines        : 100% ( 0/0 )
================================================================================
t2ym commented

Now merged to patched t2ym/web-component-tester.

gulp task to patch polyserve installations for both npm 2.x and 3.x

gulp.task('patch-polyserve', () => {
  return gulp.src([
    'node_modules/polyserve/lib/start_server.js',
    'node_modules/polyserve/lib/transform-middleware.js',
    'node_modules/web-component-tester/node_modules/polyserve/lib/start_server.js',
    'node_modules/web-component-tester/node_modules/polyserve/lib/transform-middleware.js' ], 
    { base: 'node_modules' })
    .pipe(gulpif('**/start_server.js', replace(
      "if (options.compile === 'auto' || options.compile === 'always')",
      "app._delayedAppConfig = () => {\n    if (/* patched */ options.compile === 'auto' || options.compile === 'always')", 'g')))
    .pipe(gulpif('**/start_server.js', replace(
      "return app;",
      "}\n    return /* patched */ app;", 'g')))
    .pipe(gulpif('**/transform-middleware.js', replace(
                    "newBody = transformer.transform(req, res, body);",`
                    let tmpBody = body;
                    if (Array.isArray(req._transformers)) {
                        req._transformers.forEach(_transformer => {
                            tmpBody = _transformer.transform(req, res, tmpBody);
                        });
                    }
                    newBody = transformer.transform(req, res, tmpBody);`, 'g')))
    .pipe(gulp.dest('node_modules'));
});
t2ym commented

With Polymer 2.0-preview, patched t2ym/web-component-tester-istanbul#wct6 and t2ym/web-component-tester#istanbul can properly collect coverage information.

t2ym commented

With Polymer 1.8.0, still timed out errors are observed on Sauce Labs tests. No errors of tests themselves are observed.

Some of the socket.io messages are dropped in the middle by some reason.

t2ym commented

Fixed with patched components:

t2ym/web-component-tester#istanbul
t2ym/web-component-tester-istanbul#0.10.1-wct6.6
t2ym/polyserve#0.16.0-istanbul.4
t2ym/socket.io#istanbul
t2ym/socket.io-client#istanbul
t2ym/engine.io-client#istanbul
t2ym/engine.io-parser#istanbul