Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(
projectConfig: ProjectConfig,
serverConfig: ServerConfig,
cwd: string,
callbacks: Callbacks
) {
this.projectConfig = projectConfig;
this.serverConfig = serverConfig;
this.cwd = cwd;
this.callbacks = callbacks;
// Override serverConfig host if it is undefined
if (!this.serverConfig.host) {
const possibleHost = devIp();
if (possibleHost) {
// eslint-disable-next-line prefer-destructuring
this.serverConfig.host = possibleHost[0];
}
}
// Create the webpackConfig
this.webpackConfig = new CreateWebpackConfig(
this.projectConfig,
this.serverConfig,
this.cwd,
true
);
// Check if project has typescript
const [hasTs, tsConfigPath] = hasTypeScript(this.cwd);
this.hasTs = hasTs;
this.tsConfigPath = tsConfigPath;
describe('Enigma Mixin error handling', () => {
let docName = '';
const ip = getIp()[0];
const url = `http://${ip}:9000/attendance.html`;
beforeEach(() => {
docName = Utils.getUniqueDocName();
});
it('should throw connection error if resource is misspelled', () => {
const halyard = new Halyard();
const url = 'http://www.misspelleddatasource.se/thatdoesntexists/';
halyard.addTable(url, { name: 'Table' });
return Utils.openSession(docName).then(session => session.createAppUsingHalyard(docName, halyard).then((result) => {})
.catch((err) => {
expect(err.type).to.eql('Connection Error');
describe('Connections', () => {
const ip = getIp()[0];
it('should work to load data from http', () => {
const url = `http://${ip}:9000/attendance.html`;
const halyard = new Halyard();
const table = new Halyard.Table(url, { name: 'Allsvenskan', headerRowNr: 1, characterSet: 'utf8' });
halyard.addTable(table);
const docName = Utils.getUniqueDocName();
return Utils.openSession(docName).then((session) => {
return session.createAppUsingHalyard(docName, halyard).then(result => session.openDoc(docName).then(app => app.getTableData(-1, 30, true, 'Allsvenskan').then((result) => {
expect(result[0].qValue[0].qText).to.eql('Lag');
expect(result[1].qValue[0].qText).to.eql('Hammarby');
if (globs[i].indexOf('.es6.js') !== -1) {
bs.watch(globs[i], async (e) => {
if (e === 'change') {
await buildApp()
bs.reload(globs[i])
}
})
} else {
bs.watch(globs[i])
.on('change', bs.reload)
}
}
bs.init({
host: devip(),
port: process.env.LEON_WEBAPP_PORT,
open: true,
server: {
baseDir: 'app/',
index: 'index.html'
}
})
resolve()
})