Skip to content

Commit

Permalink
chore: fix chai
Browse files Browse the repository at this point in the history
  • Loading branch information
tripodsan committed Jan 17, 2024
1 parent 71b7864 commit b7463b8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/post-deploy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
* governing permissions and limitations under the License.
*/
/* eslint-env mocha */
import chai from 'chai';
import * as chai from 'chai';
import chaiHttp from 'chai-http';
import { createTargets } from './post-deploy-utils.js';

chai.use(chaiHttp);
const { expect } = chai;
const { expect, request } = chai.use(chaiHttp);

createTargets().forEach((target) => {
describe(`Post-Deploy Tests (${target.title()}) ${target.host()}${target.urlPath()}`, () => {
Expand All @@ -29,8 +28,7 @@ createTargets().forEach((target) => {
const path = `${target.urlPath()}/rum-dashboard`;
// eslint-disable-next-line no-console
console.log(`testing ${target.host()}${path}`);
await chai
.request(target.host())
await request(target.host())
.get(path)
// set Authorization header to the universal token
.set('Authorization', `Bearer ${process.env.UNIVERSAL_TOKEN}`)
Expand All @@ -49,8 +47,7 @@ createTargets().forEach((target) => {
const path = `${target.urlPath()}/rum-pageviews?url=www.theplayers.com&offset=1`;
// eslint-disable-next-line no-console
console.log(`testing ${target.host()}${path}`);
await chai
.request(target.host())
await request(target.host())
.get(path)
.set('Authorization', `Bearer ${process.env.UNIVERSAL_TOKEN}`)
.then((response) => {
Expand All @@ -66,8 +63,7 @@ createTargets().forEach((target) => {
const path = `${target.urlPath()}/_status_check/healthcheck.json`;
// eslint-disable-next-line no-console
console.log(`testing ${target.host()}${path}`);
await chai
.request(target.host())
await request(target.host())
.get(path)
.set('Authorization', `Bearer ${process.env.UNIVERSAL_TOKEN}`)
.then((response) => {
Expand Down

0 comments on commit b7463b8

Please sign in to comment.