test.before(async () => { startingNpmVersion = await testUtil.getNpmVersion(); await testUtil.setNpmVersion(process.env.NPM_VERSION); await Promise.all([ testUtil.linkShrinkpack(projectRoot), testUtil.createTestApp(controlApp, testPackageJson), testUtil.createTestApp(shrinkpackApp, testPackageJson) ]); await testUtil.npmInstall(controlApp); await testUtil.npmInstall(shrinkpackApp); });
test.before(async () => { const pubsub = PubSub(); return pubsub.createTopic(topicName) .then((results) => { const topic = results[0]; console.log(`Topic ${topic.name} created.`); return topic; }); });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.CREATE_SET_ENDPOINT) .post('') .once() .reply(200, resp); eut = (new MessageSet()) .setApiKey('x') .setUserId('y') .setPlatform('z'); msg = eut.newMessage().setMessage('abc'); });
test.before(function () { var projectId = process.env.GCLOUD_PROJECT || 'nodejs-docs-samples'; transaction = new Transaction(projectId); metadata = new Metadata(projectId); index = new Index(projectId); entity = new Entity(projectId); query = new Query(projectId); });
test.before(async t => { console.log("before test"); loopbackClient = new LoopbackClient(apiUrl + "/api", user, password); loopbackClient.setCustomLoginPath("/users/login"); token = await loopbackClient.createToken(); console.log("token=", token); });
test.before(t => { process.chdir('./tests'); process.env.CIRCLECI = 'true'; process.env.CIRCLE_BRANCH = 'master'; process.env.CIRCLE_SHA1 = '7227818534c42cebb9ab34d8f71141501ac35a9c'; process.env.CIRCLE_PROJECT_USERNAME = 'voorhoede'; process.env.CIRCLE_PROJECT_REPONAME = 'plek'; t.context.cliPath = require.resolve(path.join('..', 'packages', 'cli')); });
test.before(async t => { // share the test static dat testStaticDat = await shareDat(__dirname + '/scaffold/test-static-dat') testStaticDatURL = 'dat://' + testStaticDat.archive.key.toString('hex') + '/' })
test.before(async () => { let pubsubRes = await pubsub.createTopic(topicName); const topic = pubsubRes[0]; console.log(`Topic ${topic.name} created.`); });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.UPDATE_ENDPOINT) .put('') .query({api_key: 'x', message_id: 'abc'}) .once() // Please observe the status property of the body versus the response status .reply(200, {status: 500}); });
test.before((t) => { if (!QUEUE) { t.fail(`You must set the GCP_QUEUE environment variable!`); } });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.CREATE_ENDPOINT) .post('') .once() .reply(200, resp); eut = (new MessageStateWrapper('x', 'y')) .setPlatform('z') .setMessage('abc'); });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.CREATE_SET_ENDPOINT) .post('') .once() // Please observe the status property of the body versus the response status .reply(200); });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.CREATE_ENDPOINT) .post('') .once() // Please observe the status property of the body versus the response status .reply(200, {status: 500}); });
test.before(async () => { const pubsub = PubSub(); return pubsub.createTopic(topicName) .then((results) => { const topic = results[0]; console.log(`Topic ${topic.name} created.`); return topic; }); });
test.before(t => { nock.disableNetConnect(); scope = nock(Transport.CREATE_SET_ENDPOINT) .post('') .once() // Please observe the status property of the body versus the response status .reply(200, {status: 500}); });