This testing infrastructure includes them both with Jasmine as the test suite and Karma as the test runner for unit tests. Protractor serves as the integration tests framework. Both tests can be run separately as described in Commands below.
All tests are located within
/tests. Each pull request is validated on
Travis, which runs the test executing the
command. You can also run this command locally, if you followed the
The following commands are available to you:
gulp testsruns the entire test suite
gulp tests:unitonly runs the unit tests
gulp tests:integrationonly runs the integration tests
gulp tests:watchto start karma to watch unit tests
Unit tests should be prefixed using
test before the name file name and
integration tests use
spec. For example:
test.header.js test.footer.js test.content.typography.js test.content.wysiwyg.js ...
spec.header.js spec.footer.js spec.content.typography.js spec.content.wysiwyg.js ...
Unit tests are located within
/tests/unit and integration tests within
/tests/integration to create a clear separation. There are several
configuration files available within the
/tests directory described in
Unit Tests and Integration Tests respectively.
The starting structure looks like this:
tests/ ├─ fixtures/ ├─ integration/ ├─ unit/ ├─ base.conf.js ├─ karma.conf.js └─ protractor.conf.js
Fixtures and coverage are described in more depth within Unit Tests.
The configuration files are located at the root of the
karma.conf.js defines the settings for the
gulp tests:unit command and
protractor.conf.js for the
gulp tests:integration command.
Browserslist enables us to provide a compiled and ready to use browser-list to services such as Sauce Labs, Autoprefixer and more.
Simply add the required browser to the
browserslist file. Our configuration
includes the last 2 versions and ie >= 9.