Skip to content

Commit

Permalink
test: increase debounce time for rebuild tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and vikerman committed Nov 6, 2019
1 parent 3f38e4e commit d438cf0
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import {

describe('Browser Builder rebuilds', () => {
const target = { project: 'app', target: 'build' };
// Rebuild tests are especially sensitive to time between writes due to file watcher
// behaviour. Give them a while.
const rebuildDebounceTime = 3000;
let architect: Architect;

beforeEach(async () => {
Expand Down Expand Up @@ -77,7 +80,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides);
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(result => {
expect(result.success).toBe(true, 'build should succeed');
const hasLazyChunk = host.scopedSync().exists(normalize('dist/lazy-lazy-module.js'));
Expand Down Expand Up @@ -128,7 +131,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides);
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => expect(buildEvent.success).toBe(true)),
tap(() => host.appendToFile('src/app/app.component.css', ':host { color: blue; }')),
take(2),
Expand Down Expand Up @@ -158,7 +161,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides, { logger });
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => {
buildNumber += 1;
switch (buildNumber) {
Expand Down Expand Up @@ -211,7 +214,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides);
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => expect(buildEvent.success).toBe(true)),
tap(() => host.writeMultipleFiles({ 'src/type.ts': `export type MyType = string;` })),
take(2),
Expand All @@ -234,7 +237,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides, { logger });
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => {
buildNumber++;
switch (buildNumber) {
Expand Down Expand Up @@ -291,7 +294,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides, { logger });
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => {
buildNumber += 1;
switch (buildNumber) {
Expand Down Expand Up @@ -365,7 +368,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides);
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => {
buildNumber += 1;
const fileName = './dist/main.js';
Expand Down Expand Up @@ -455,7 +458,7 @@ describe('Browser Builder rebuilds', () => {
const run = await architect.scheduleTarget(target, overrides);
await run.output
.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(buildEvent => {
buildNumber += 1;
switch (buildNumber) {
Expand Down Expand Up @@ -486,7 +489,7 @@ describe('Browser Builder rebuilds', () => {
let buildCount = 1;
const run = await architect.scheduleTarget(target, overrides);
await run.output.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(() => {
const content = virtualFs.fileBufferToString(
host.scopedSync().read(join(outputPath, 'main.js')),
Expand Down Expand Up @@ -516,7 +519,7 @@ describe('Browser Builder rebuilds', () => {
let buildCount = 1;
const run = await architect.scheduleTarget(target, overrides);
await run.output.pipe(
debounceTime(1000),
debounceTime(rebuildDebounceTime),
tap(() => {
const content = virtualFs.fileBufferToString(
host.scopedSync().read(join(outputPath, 'main.js')),
Expand Down

0 comments on commit d438cf0

Please sign in to comment.