Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I run a specific test using the Polymer web-component-tester?

While developing a Polymer web component, more specifically while adding additional tests, it can become quite cumbersome to run all of the component's test each time I make an adjustment to the tests.

The simplest answer would be to comment out the tests that shouldn't run, but this also gets a but tiresome.

Since the web-component-tester makes use of Mocha there should probably be some way of indicating only a specific set of test to run. It's easy to target a specific file, but how would one go about targeting a specific test inside a file?

like image 953
juriejan Avatar asked Jul 06 '16 08:07

juriejan


People also ask

How do you test a Web component?

The Web Component Test Execution Environment As of writing this, the only viable way of running tests for Web Components is through Karma which executes them through a target browser. People coming from current technologies, such as React, Angular or Vue, might be disappointed with the current state of matters.


1 Answers

Have you tried exclusive tests in mocha? Example form documentation

describe('Array', function() {
  describe.only('#indexOf()', function() {
    // ...
  });
});
like image 161
Serg Avatar answered Dec 07 '22 19:12

Serg