Skip to content

Commit ba423cc

Browse files
committed
move onerror-per-visit test to scenario-tester
1 parent c6962b3 commit ba423cc

File tree

14 files changed

+209
-66535
lines changed

14 files changed

+209
-66535
lines changed

packages/fastboot/test/fastboot-test.js

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -337,125 +337,6 @@ describe('FastBoot', function() {
337337
});
338338
});
339339

340-
it('errors can be properly attributed with buildSandboxPerVisit=true', async function() {
341-
this.timeout(3000);
342-
343-
var fastboot = new FastBoot({
344-
distPath: fixture('onerror-per-visit'),
345-
});
346-
347-
let first = fastboot.visit('/slow/100/reject', {
348-
buildSandboxPerVisit: true,
349-
request: { url: '/slow/100/reject', headers: {} },
350-
});
351-
352-
let second = fastboot.visit('/slow/50/resolve', {
353-
buildSandboxPerVisit: true,
354-
request: { url: '/slow/50/resolve', headers: {} },
355-
});
356-
357-
let third = fastboot.visit('/slow/25/resolve', {
358-
buildSandboxPerVisit: true,
359-
request: { url: '/slow/25/resolve', headers: {} },
360-
});
361-
362-
await Promise.all([second, third]);
363-
364-
await first.then(
365-
() => {
366-
throw new Error('Visit should not resolve!');
367-
},
368-
error => {
369-
expect(error.code).to.equal('from-slow');
370-
expect(error.fastbootRequestPath).to.equal('/slow/100/reject');
371-
}
372-
);
373-
});
374-
375-
it('it eagerly builds sandbox when queue is empty', async function() {
376-
this.timeout(3000);
377-
378-
var fastboot = new FastBoot({
379-
distPath: fixture('onerror-per-visit'),
380-
maxSandboxQueueSize: 2,
381-
});
382-
383-
let first = fastboot.visit('/slow/50/resolve', {
384-
buildSandboxPerVisit: true,
385-
request: { url: '/slow/50/resolve', headers: {} },
386-
});
387-
388-
let second = fastboot.visit('/slow/50/resolve', {
389-
buildSandboxPerVisit: true,
390-
request: { url: '/slow/50/resolve', headers: {} },
391-
});
392-
393-
let third = fastboot.visit('/slow/25/resolve', {
394-
buildSandboxPerVisit: true,
395-
request: { url: '/slow/25/resolve', headers: {} },
396-
});
397-
398-
let result = await first;
399-
let analytics = result.analytics;
400-
expect(analytics).to.be.deep.equals({
401-
usedPrebuiltSandbox: true,
402-
});
403-
404-
result = await second;
405-
analytics = result.analytics;
406-
expect(analytics).to.be.deep.equals({
407-
usedPrebuiltSandbox: true,
408-
});
409-
410-
result = await third;
411-
analytics = result.analytics;
412-
expect(analytics).to.be.deep.equals({
413-
usedPrebuiltSandbox: false,
414-
});
415-
});
416-
417-
it('it leverages sandbox from queue when present', async function() {
418-
this.timeout(3000);
419-
420-
var fastboot = new FastBoot({
421-
distPath: fixture('onerror-per-visit'),
422-
maxSandboxQueueSize: 3,
423-
});
424-
425-
let first = fastboot.visit('/slow/50/resolve', {
426-
buildSandboxPerVisit: true,
427-
request: { url: '/slow/50/resolve', headers: {} },
428-
});
429-
430-
let second = fastboot.visit('/slow/50/resolve', {
431-
buildSandboxPerVisit: true,
432-
request: { url: '/slow/50/resolve', headers: {} },
433-
});
434-
435-
let third = fastboot.visit('/slow/25/resolve', {
436-
buildSandboxPerVisit: true,
437-
request: { url: '/slow/25/resolve', headers: {} },
438-
});
439-
440-
let result = await first;
441-
let analytics = result.analytics;
442-
expect(analytics).to.be.deep.equals({
443-
usedPrebuiltSandbox: true,
444-
});
445-
446-
result = await second;
447-
analytics = result.analytics;
448-
expect(analytics).to.be.deep.equals({
449-
usedPrebuiltSandbox: true,
450-
});
451-
452-
result = await third;
453-
analytics = result.analytics;
454-
expect(analytics).to.be.deep.equals({
455-
usedPrebuiltSandbox: true,
456-
});
457-
});
458-
459340
it('htmlEntrypoint works', function() {
460341
var fastboot = new FastBoot({
461342
distPath: fixture('html-entrypoint'),

packages/fastboot/test/fixtures/onerror-per-visit/assets/onerror-per-visit-fastboot.js

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/fastboot/test/fixtures/onerror-per-visit/assets/onerror-per-visit-fastboot.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/fastboot/test/fixtures/onerror-per-visit/assets/onerror-per-visit.css

Whitespace-only changes.

0 commit comments

Comments
 (0)