2015-03-06 14:46:33 -05:00
|
|
|
import { bind } from 'angular2/di';
|
|
|
|
import { JsonFileReporter } from './common';
|
|
|
|
|
2015-03-02 12:23:09 -05:00
|
|
|
export * from './common';
|
|
|
|
export { SeleniumWebDriverAdapter } from './src/webdriver/selenium_webdriver_adapter';
|
2015-03-06 14:46:33 -05:00
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
|
|
|
|
// Note: Can't do the `require` call in a facade as it can't be loaded into the browser!
|
|
|
|
JsonFileReporter.BINDINGS.push(
|
|
|
|
bind(JsonFileReporter.WRITE_FILE).toValue(writeFile)
|
|
|
|
);
|
|
|
|
|
|
|
|
function writeFile(filename, content) {
|
|
|
|
return new Promise(function(resolve, reject) {
|
|
|
|
fs.writeFile(filename, content, (error) => {
|
|
|
|
if (error) {
|
|
|
|
reject(error);
|
|
|
|
} else {
|
|
|
|
resolve();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|