Skip to content

Commit 597d6fb

Browse files
authored
Moved examples error and csp-errors.html to a test fixtures dir (#1255)
1 parent c0cdb42 commit 597d6fb

File tree

8 files changed

+16
-20
lines changed

8 files changed

+16
-20
lines changed

Gruntfile.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ function buildGruntKarmaConfig(singleRun, tests, reporters) {
6060
served: true,
6161
watched: false,
6262
},
63+
// Test fixture HTML files
64+
{
65+
pattern: 'test/fixtures/**/*.html',
66+
included: true,
67+
served: true,
68+
watched: false,
69+
},
6370
],
6471
},
6572
};

examples/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ const rollbar = new Rollbar({
7777

7878
- **[snippet.html](./snippet.html)** - Async snippet integration
7979
- **[script.html](./script.html)** - Direct script tag
80-
- **[error.html](./error.html)** - Error handling examples
8180
- **[test.html](./test.html)** - Test page
8281
- **[itemsPerMinute.html](./itemsPerMinute.html)** - Rate limiting demo
83-
- **[csp-errors.html](./csp-errors.html)** - Content Security Policy testing
8482
- **[include_custom_object.html](./include_custom_object.html)** - Custom data example
8583

8684
## Testing Examples

karma.conf.cjs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ module.exports = function (config) {
55
// The Travis environment has these specified.
66
// To run BrowserStack tests locally, specify the environment variables:
77
// BROWSER_STACK_USERNAME, BROWSER_STACK_ACCESS_KEY
8-
browserStack: {
9-
username: null,
10-
accessKey: null,
11-
},
8+
browserStack: { username: null, accessKey: null },
129

13-
client: {
14-
captureConsole: true,
15-
},
10+
client: { captureConsole: true },
1611

1712
// Files are specified in the grunt-karma configuration in Gruntfile.cjs
1813
//files: []
@@ -33,6 +28,7 @@ module.exports = function (config) {
3328
proxies: {
3429
'/dist/': '/base/dist/',
3530
'/examples/': '/base/examples/',
31+
'/test/': '/base/test/',
3632
},
3733

3834
customHeaders: [
@@ -63,10 +59,7 @@ module.exports = function (config) {
6359
loader: 'babel-loader',
6460
exclude: [/node_modules/, /vendor/, /lib/, /dist/, /test/],
6561
},
66-
{
67-
test: /(mootootls|requirejs)\.js$/,
68-
loader: 'script',
69-
},
62+
{ test: /(mootootls|requirejs)\.js$/, loader: 'script' },
7063
{
7164
enforce: 'post',
7265
test: /\.js$/,
@@ -77,8 +70,6 @@ module.exports = function (config) {
7770
},
7871
},
7972

80-
webpackMiddleware: {
81-
noInfo: true,
82-
},
73+
webpackMiddleware: { noInfo: true },
8374
});
8475
};

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/browser.core.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Rollbar from '../src/browser/core.js';
99
describe('options.captureUncaught', function () {
1010
beforeEach(function (done) {
1111
// Load the HTML page, so errors can be generated.
12-
document.write(window.__html__['examples/error.html']);
12+
document.write(window.__html__['test/fixtures/html/error.html']);
1313

1414
window.server = sinon.createFakeServer();
1515
done();

test/browser.rollbar.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ describe('configure', function () {
330330
describe('options.captureUncaught', function () {
331331
beforeEach(function (done) {
332332
// Load the HTML page, so errors can be generated.
333-
document.write(window.__html__['examples/error.html']);
333+
document.write(window.__html__['test/fixtures/html/error.html']);
334334

335335
window.server = sinon.createFakeServer();
336336
done();
@@ -1312,7 +1312,7 @@ describe('options.autoInstrument', function () {
13121312
var queueStub = sinon.stub(queue, '_makeApiRequest');
13131313

13141314
// Load the HTML page, so errors can be generated.
1315-
document.write(window.__html__['examples/csp-errors.html']);
1315+
document.write(window.__html__['test/fixtures/html/csp-errors.html']);
13161316

13171317
setTimeout(function () {
13181318
try {
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)