Skip to content

Commit

Permalink
chore(deps): update external major (major) (#247)
Browse files Browse the repository at this point in the history
* chore(deps): update external major

* chore: fix chai import

* chore: fix chai import

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tobias Bocanegra <[email protected]>
  • Loading branch information
renovate[bot] and tripodsan authored Jan 10, 2024
1 parent 60aec1b commit 21f359b
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 76 deletions.
111 changes: 54 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@semantic-release/changelog": "6.0.3",
"@semantic-release/exec": "6.0.3",
"@semantic-release/git": "10.0.1",
"c8": "8.0.1",
"chai": "4.4.0",
"c8": "9.0.0",
"chai": "5.0.0",
"chai-http": "4.4.0",
"codecov": "3.8.3",
"eslint": "8.56.0",
Expand Down
35 changes: 18 additions & 17 deletions test/post-deploy.test.js → test/post-deploy.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@
* governing permissions and limitations under the License.
*/
/* eslint-env mocha */
const { expect } = require('chai');
const chai = require('chai');
const chaiHttp = require('chai-http');
import { expect } from 'chai';
import * as chai from 'chai';
import chaiHttp from 'chai-http';

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

chai.use(chaiHttp);
const domain = !process.env.CI ? 'rum.hlx3.page' : 'helix-rum-collector-ci.edgecompute.app';

console.log(`Using ${domain}`);

describe('Helix RUM Collector Post-Deploy Tests', () => {
it('Missing body returns 400', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/');
expect(response).to.have.status(400);
});

it('RUM collection with masked timestamp (t) returns 201', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send({
t: 1234,
Expand All @@ -43,7 +44,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
});

it('RUM collection returns 201', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send({
cwv: {
Expand All @@ -58,7 +59,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
});

it('RUM collection with empty string id returns 201', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send({
cwv: {
Expand All @@ -73,37 +74,37 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
});

it('RUM collection via GET returns 201', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/.rum/1?data=%7B%22checkpoint%22%3A%22noscript%22%2C%22weight%22%3A1%7D');
expect(response).to.have.status(201);
});

it('robots.txt denies everything', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/robots.txt');
expect(response).to.have.status(200);
// eslint-disable-next-line no-unused-expressions
expect(response).to.be.text;
});

it('web vitals module is being served', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/.rum/[email protected]/dist/web-vitals.base.js');
expect(response).to.have.status(200);
// eslint-disable-next-line no-unused-expressions
expect(response).to.have.header('content-type', /^application\/javascript/);
});

it('web vitals module is being served without redirect', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/.rum/web-vitals/dist/web-vitals.base.js');
expect(response).to.have.status(200);
// eslint-disable-next-line no-unused-expressions
expect(response).to.have.header('content-type', /^application\/javascript/);
});

it('rum js module is being served without redirect', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/.rum/@adobe/helix-rum-js@^1/src/index.js');
expect(response).to.have.status(200);
// eslint-disable-next-line no-unused-expressions
Expand All @@ -113,7 +114,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
}).timeout(5000);

it.skip('rum js module is being served with default replacements', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.get('/.rum/@adobe/[email protected]/src/index.js')
.buffer(true);
expect(response).to.have.status(200);
Expand All @@ -123,7 +124,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
}).timeout(5000);

it('Missing id returns 400', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send({
cwv: {
Expand All @@ -137,7 +138,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
});

it('Non-numeric weight returns 400', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send({
cwv: {
Expand All @@ -152,7 +153,7 @@ describe('Helix RUM Collector Post-Deploy Tests', () => {
});

it('Non-object root returns 400', async () => {
const response = await chai.request(`https://${domain}`)
const response = await request(`https://${domain}`)
.post('/')
.send([]);
expect(response).to.have.status(400);
Expand Down

0 comments on commit 21f359b

Please sign in to comment.