2015-05-27 17:57:54 -04:00
|
|
|
/// <reference path="../angular2/typings/node/node.d.ts" />
|
|
|
|
|
2015-09-04 01:01:36 -04:00
|
|
|
import {bind} from 'angular2/src/core/di';
|
2015-05-27 17:57:54 -04:00
|
|
|
import {Options} from './common';
|
2015-03-06 14:46:33 -05:00
|
|
|
|
2015-03-02 12:23:09 -05:00
|
|
|
export * from './common';
|
2015-05-27 17:57:54 -04:00
|
|
|
export {SeleniumWebDriverAdapter} from './src/webdriver/selenium_webdriver_adapter';
|
2015-03-06 14:46:33 -05:00
|
|
|
|
|
|
|
var fs = require('fs');
|
|
|
|
|
2015-03-06 20:34:27 -05:00
|
|
|
// TODO(tbosch): right now we bind the `writeFile` method
|
|
|
|
// in benchpres/benchpress.es6. This does not work for Dart,
|
|
|
|
// find another way...
|
|
|
|
// Note: Can't do the `require` call in a facade as it can't be loaded into the browser
|
|
|
|
// for our unit tests via karma.
|
2015-05-27 17:57:54 -04:00
|
|
|
Options.DEFAULT_BINDINGS.push(bind(Options.WRITE_FILE).toValue(writeFile));
|
2015-03-06 14:46:33 -05:00
|
|
|
|
2015-05-27 17:57:54 -04:00
|
|
|
function writeFile(filename, content): Promise<any> {
|
2015-03-06 14:46:33 -05:00
|
|
|
return new Promise(function(resolve, reject) {
|
|
|
|
fs.writeFile(filename, content, (error) => {
|
|
|
|
if (error) {
|
|
|
|
reject(error);
|
|
|
|
} else {
|
|
|
|
resolve();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|