-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): update external major (major) (#247)
* 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
1 parent
60aec1b
commit 21f359b
Showing
3 changed files
with
74 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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, | ||
|
@@ -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: { | ||
|
@@ -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: { | ||
|
@@ -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 | ||
|
@@ -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); | ||
|
@@ -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: { | ||
|
@@ -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: { | ||
|
@@ -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); | ||
|