Пример #1
0
      async () => {
        const wctCliRunStub =
            sandbox.stub(wct.cli, 'run').returns(Promise.resolve());
        const cli = new PolymerCli(['test', '--npm']);
        await cli.run();

        const wctArgs = wctCliRunStub.args[0][1];
        assert.includeMembers(wctCliRunStub.args[0][1], ['--npm']);
        assert.includeMembers(wctArgs, [`--component-dir='node_modules/'`]);
      });
Пример #2
0
								return helper.listDefPaths(info.typingsDir).then((typings:string[]) => {
									assert.includeMembers(typings, context.config.getInstalledPaths(), 'saved installed file');
									if (test.modify && test.modify.written) {
										var writenPaths = tsd.DefUtil.getPathsOf(xm.valuesOf(result.written));
										assert.sameMembers(writenPaths.sort(), test.modify.written.sort(), 'written: files');
									}
								});
Пример #3
0
export async function assertViewsExist(db: SQLDatabase, viewNames: string[]) {
  let allViews = await db.getAllViews();
  assert.includeMembers(
    allViews.map(s => s.toLowerCase()),
    viewNames.map(s => s.toLowerCase()),
    `${viewNames.join(', ')} view(s) found`
  );
}
Пример #4
0
export async function assertTableExists(db: SQLDatabase, tableName: string) {
  let allTables = await db.getAllTableNames();
  assert.includeMembers(
    allTables.map(t => t.toLowerCase()),
    [tableName],
    `${tableName} table is found`
  );
}
Пример #5
0
  test('--module-resolution flag is passed to WCT', async () => {
    const wctCliRunStub = sinon.stub(wct.cli, 'run').returns(Promise.resolve());
    const cli = new PolymerCli(['test', '--module-resolution=none']);
    await cli.run();

    const wctArgs = wctCliRunStub.args[0][1];
    assert.includeMembers(wctArgs, [`--module-resolution=none`]);
  });
 @test('Function table_update_notify is found')
 public async productIndicesPresent() {
   let db = await getDb();
   let indexInfo = await db.getAllFunctions();
   assert.includeMembers(indexInfo.map(s => s.toLowerCase()), [
     'table_update_notify'
   ]);
 }
Пример #7
0
 @test('Creating an order results in a refreshAll')
 public async productIndicesPresent() {
   let db = await getDb();
   let indexInfo = await db.getAllFunctions();
   assert.includeMembers(indexInfo.map(s => s.toLowerCase()), [
     'table_update_notify'
   ]);
 }
Пример #8
0
  test('--component-dir flag is passed to WCT', async () => {
    const wctCliRunStub = sinon.stub(wct.cli, 'run').returns(Promise.resolve());
    const cli = new PolymerCli(['test', '--component-dir=path/to/deps/']);
    await cli.run();

    const wctArgs = wctCliRunStub.args[0][1];
    assert.isOk(!wctArgs.includes('--npm'));
    assert.includeMembers(wctArgs, [`--component-dir='path/to/deps/'`]);
  });
Пример #9
0
export async function assertTriggersExist(
  db: SQLDatabase,
  triggerNames: string[]
) {
  let allTriggers = await db.getAllTriggers();
  assert.includeMembers(
    allTriggers.map(s => s.toLowerCase()),
    triggerNames.map(s => s.toLowerCase()),
    `${triggerNames.join(', ')} trigger(s) found`
  );
}
 @test('Querying the view yields expected results')
 public async viewResults() {
   let db = await getDb();
   let result = await db.get(sql`SELECT * from SupplierList_V`);
   assert.ok(result, 'Results of query are truthy');
   assert.includeMembers(
     Object.keys(result),
     ['id', 'companyname', 'contactname', 'productlist'],
     "Columns: 'id', 'companyname', 'contactname', 'productlist'"
   );
 }