0

I'm kinda new in front-end testing, and I decided to get started with it using intern. Among all the problems that we all have when starting with new technologies, I'm having one that I find really annoying.

Currently, I'm doing this in intern.js:

suites: [
  '../../../../../test/intern/app/suite-one',
  '../../../../../test/intern/app/suite-two',
  '../../../../../test/intern/app/suite-three'
  ...
],

How can I specify a base path, so intern can run all tests inside that path?

Something like suites: [ '../../../test/intern/*' ]. Is there any way to do that?

Already saw this (How do you specify test suites in Intern using a wildcard?), but it's not really good.

Also, is there any way to specify a base path to only tests suites? So I could get rid of the ugly ../../../ hell.

Community
  • 1
  • 1
Denis Lins
  • 816
  • 7
  • 22

1 Answers1

0

Unfortunately there's no support for wildcards; using a module to group tests (as suggested in the answer you linked to) is the way to go. You can shorten the paths you use by defining a package for your app:

loader: {
    packages: [{ name: 'myApp', location: '../../../../..' }]
},

suites: [
    'myApp/test/intern/app/suite-one',
    'myApp/test/intern/app/suite-two'
]

However, I'm curious about your project layout. Generally the test config lives near the test suites (at least that's how I've always seen it), in which case you wouldn't need such huge paths.

jason0x43
  • 3,363
  • 1
  • 16
  • 15
  • Yes, it was my first setup, so I was getting some things wrong. Mostly about where to place the tests. I still have the wildcard issue though :( – Denis Lins Aug 21 '14 at 17:25
  • 1
    I had the same issue (and a few other path related ones) and eventually gave up trying and setup `karma` in one hour ... it's got path globbing like `**/*.js` and is well documented. – danba Feb 26 '15 at 10:57