-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require() in config file does not hangle relative paths #304
Comments
I'm really leaning towards changing the config file to be required as any other source file. It will make the config file a bit more verbose, but will solve all these issues. The syntax might be something like:
Or
|
👍 for the first run. This would make it easy for all people familiar withgrunt config. |
I've written up an alternative suggestion that is a much cleaner solution to this in my opinion. You can see it in this gist. In short the idea is to use YAML as config file format with some extras on top to keep all necessary options available. |
I feel very strongly about having the config file in JavaScript. It's powerful. You can require other files, you can easily read env variables... and once we refactor for plugins, it allows for inlining plugins and many many other stuff. Everyone who uses Testacular is familiar with JS. |
I see your points. Alright if JS then im all for something along the lines of module.exports = function(testacular) {
testacular.configure({
browsers: ['Safari', 'Chrome'],
reporters: ['dots']
});
// Maybe some plugin loading commands here on the testacular object
}; |
@pavelgj Let's do this instead...
|
@vojtajina SGTM. +1 on doing it the right way. Did you already start working on it or do you want me to give it a shot? |
I have it pretty much done. I just need to decide which API is the best. I On Wed, Apr 3, 2013 at 8:53 PM, Pavel Jbanov notifications@github.comwrote:
|
module.exports = function(karma) {
karma.configure({
basePath: '../',
files: ['src/**/*.js']
});
// custom DSL
karma.definePreprocessor('coffee_bare', {
name: 'coffee',
args: {'bare': false}
});
karma.defineLauncher('chrome', {
name: 'Chrome',
args: ['--flag']
});
}; |
Only abs paths work:
require(__dirname + '/something.js');
, because the require behaves as if it was run withinconfig.js
file, so you can load Testacular's source modules ;-)The text was updated successfully, but these errors were encountered: