const { execSync } = require('child_process');
const path = require('path');
const tests = [
  'test_package_json.js',
  'test_pack_inspect.js'
];

const cwd = path.join(__dirname);
let failed = false;
for (const t of tests) {
  console.log('Running', t);
  try {
    execSync(`node ${t}`, { cwd, stdio: 'inherit' });
  } catch (e) {
    console.error(t, 'failed');
    failed = true;
    break;
  }
}
process.exit(failed ? 1 : 0);
