I’m having a lot of issues grabbing dependent files into my intern/cucumber tests. Here’s some background, I really hope someone can help! I’m making a change from Karma/Intern/Dojo —> Cucumber/intern/Dojo and I really want to replicate the “karma.config” file to “intern.json”
Basically, I have existing tests that have been created with intern and Karma. The karma configuration file preloads all dependencies in patterns, and specifies a basePath which all files are related to. I have a ton of dependencies, and I've been trying to manually map them in my intern.json file but there are so many, it seems like there could be an easier way? here are how my two files look:
//configuration, for unit testing, this is my karma.conf.js
module.exports = function (config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '../../../../../..',
// frameworks to use
frameworks: ['intern'],
preprocessors: {
},
// list of files / patterns to load in the browser, etc
files: [
{ pattern: 'FC/WorkFolder/Views/**/*.*', included: false, served: true, watched: false },
// list of files to exclude
exclude: [
],
reporters: ['progress', 'html'],
htmlReporter: {
outputFile: 'Tools/Karma/HRunitTestReport.html'
}
});
So, main idea is that all the files are relative to that specified basePath, so when its pulling all the dependencies from hundreds of files, it always gets resolved and finds the files. My intern.json file looks like this:
{
"loader": {
"script": "dojo",
"options": {
"packages": [
{
"name": "features",
"location": "features"
},
{
"name": "HR",
"location": "../../../../../../WorkFolder/Scripts/Vews"
},
{
"name": "dojo",
"location": "node_modules/dojo"
},
..etc. I'm basically manually mapping them so that its not searched for within the same folder that intern.json is contained in. its been working so far. but there are too many dependencies and I don't want to map all of them
Any help on how basePath works for intern and how I can imitate it will be super helpful