function verifyView()

in tools/verifyDBMigration/index.js [113:133]


function verifyView() {
    var db = cloudant.db.use(db_name);

    console.log('Verifying view exists and works as expected');
    return ensureViewReturns(db, 0)
        .then(() => {
            return db.insert({
                triggerURL: 'this is the only property needed by the view'
            });
        })
        .then(() => {
            // give it a few extra seconds to make sure the view is indexed
            return new Promise((resolve, reject) => {
                setTimeout(() => {
                    ensureViewReturns(db, 1)
                        .then(resolve)
                        .catch(reject);
                }, 3000);
            });
        });
}