How to make travis execute Angular tests on Chrome (“Please set env variable CHROME_BIN”)

Use this solution to get it running using the preinstalled Chromium Version in Travis-CI VM: https://github.com/karma-runner/karma/issues/1144#issuecomment-53633076 .travis.yml node_js: – “0.10” script: node_modules/karma/bin/karma start test/karma.conf.js –single-run before_install: – export CHROME_BIN=chromium-browser – export DISPLAY=:99.0 – sh -e /etc/init.d/xvfb start karma.conf.js module.exports = function(config) { var configuration = { /* … */ // start these browsers browsers: [‘Chrome’, … Read more

Is there something like a jasmine `toNotContain` acceptance criteria for tests?

According to the documentation, you can use not: getJasmineRequireObj().not.toContain This example is from here: describe(“The ‘toBe’ matcher compares with ===”, function() { Matchers Each matcher implements a boolean comparison between the actual value and the expected value. It is responsible for reporting to Jasmine if the expectation is true or false. Jasmine will then pass … Read more

karma plugin dependencies not being found

There are a two seemingly-similar complaints when first getting started with Karma: [preprocess]: Can not load “webpack”, it is not registered! Perhaps you are missing some plugin? and [plugin]: Cannot find plugin “karma-webpack”. Did you forget to install it ? npm install karma-webpack –save-dev The following is my best recommendation for fixing these two problems … Read more

How do you use Istanbul Code Coverage with transpiled Typescript?

TL;DR: There is a tool: https://github.com/SitePen/remap-istanbul described as A tool for remapping Istanbul coverage via Source Maps The article on Sitepan describes it in more detail: Intern as well as other JavaScript testing frameworks utilise Istanbul for their code coverage analysis. As we started to adopt more and more TypeScript for our own projects, we … Read more

Karma, PhantomJS and es6 Promises

You can pull in the Babel polyfill by simply installing Babel Polyfill: npm install –save-dev babel-polyfill and then include the polyfill file before your source and test files within the files section of your karma.conf.js: files: [ ‘node_modules/babel-polyfill/dist/polyfill.js’, ‘index.js’, //could be /src/**/*.js ‘index.spec.js’ //could be /test/**/*.spec.js ], Unless you know that all your target browsers … Read more

How do unit test with angular-translate

it’s a known issue, please follow the documentation here: unit testing angular The solution Unfortunately, this issue is caused by the design of angular-translate. To get around these errors, all we can do is to overwrite our module configuration in our test suite, that it doesn’t use asynchronous loader at all. When there’s no asynchronous … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)