mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2025-12-19 04:27:45 +00:00
major merge of features from the hosted branch that was created temporarily during the initial launch of jambonz.org
28 lines
916 B
JavaScript
28 lines
916 B
JavaScript
const test = require('tape');
|
|
const exec = require('child_process').exec ;
|
|
const pwd = '-p$MYSQL_ROOT_PASSWORD';
|
|
|
|
test('creating jambones_test database', (t) => {
|
|
exec(`mysql -h 127.0.0.1 -u root --protocol=tcp < ${__dirname}/db/create_test_db.sql`, (err, stdout, stderr) => {
|
|
if (err) return t.end(err);
|
|
t.pass('database successfully created');
|
|
t.end();
|
|
});
|
|
});
|
|
|
|
test('creating schema', (t) => {
|
|
exec(`mysql -h 127.0.0.1 -u root --protocol=tcp -D jambones_test < ${__dirname}/db/jambones-sql.sql`, (err, stdout, stderr) => {
|
|
if (err) return t.end(err);
|
|
t.pass('schema successfully created');
|
|
t.end();
|
|
});
|
|
});
|
|
|
|
test('populating test case data', (t) => {
|
|
exec(`mysql -h 127.0.0.1 -u root --protocol=tcp -D jambones_test < ${__dirname}/db/populate-test-data.sql`, (err, stdout, stderr) => {
|
|
if (err) return t.end(err);
|
|
t.pass('test data set created');
|
|
t.end();
|
|
});
|
|
});
|