From c108af8ed973c74cdfecbf3cfb104e6b6c5e9bde Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Mon, 17 Sep 2018 19:57:02 +0100 Subject: [PATCH] lerna: more path updates --- crossbow.yaml | 31 +++++++++++++++++++++ cypress/configs/file-reloading.js | 2 +- cypress/integration/css-console-notify.js | 4 +-- cypress/integration/css-overlay-notify.js | 2 +- cypress/integration/file-reloading.js | 14 +++++----- cypress/integration/file-watching-ignore.js | 2 +- cypress/integration/logPrefix.js | 2 +- cypress/integration/no-notify.js | 2 +- cypress/setup/bs.js | 2 +- packages/browser-sync/crossbow.yaml | 29 ------------------- 10 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 crossbow.yaml diff --git a/crossbow.yaml b/crossbow.yaml new file mode 100644 index 000000000..bf7f6242d --- /dev/null +++ b/crossbow.yaml @@ -0,0 +1,31 @@ +tasks: + cy: cypress/setup/bs.js + +options: + cy: + _default: + action: run + file-watching-ignore: + config: cypress/configs/file-watching-ignore.js + spec: cypress/integration/file-watching-ignore.js + file-reloading: + config: cypress/configs/file-reloading.js + spec: cypress/integration/file-reloading.js + no-notify: + config: cypress/configs/no-notify.js + spec: cypress/integration/no-notify.js + css-overlay: + config: cypress/configs/css-overlay-notify.js + spec: cypress/integration/css-overlay-notify.js + css-console-notify: + config: cypress/configs/css-console-notify.js + spec: cypress/integration/css-console-notify.js + connection-notify: + config: cypress/configs/file-reloading.js + spec: cypress/integration/connection-notify.js + log-prefix: + config: cypress/configs/logPrefix.js + spec: cypress/integration/logPrefix.js + ui-remote-debug: + config: cypress/configs/file-reloading.js + spec: cypress/integration/ui-remote-debug.js \ No newline at end of file diff --git a/cypress/configs/file-reloading.js b/cypress/configs/file-reloading.js index 85a59d5a2..d8cf9ed30 100644 --- a/cypress/configs/file-reloading.js +++ b/cypress/configs/file-reloading.js @@ -1,5 +1,5 @@ module.exports = { - server: 'test/fixtures', + server: 'packages/browser-sync/test/fixtures', open: false, watch: true, online: false, diff --git a/cypress/integration/css-console-notify.js b/cypress/integration/css-console-notify.js index d5b497fbd..9122f5604 100644 --- a/cypress/integration/css-console-notify.js +++ b/cypress/integration/css-console-notify.js @@ -5,7 +5,7 @@ describe('CSS console notification', function() { it('should log message when css injected', function() { cy.window().then((win) => { const spy = cy.spy(win.console, "log"); - cy.exec('touch test/fixtures/**/style.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/style.css'); cy.wait(1000).then(() => { expect(spy.getCall(0).args.slice(-1)[0]).to.equal('[LinkReplace] style.css'); }) @@ -14,7 +14,7 @@ describe('CSS console notification', function() { it('should log 2 messages when 2 css files injected', function() { cy.window().then((win) => { const spy = cy.spy(win.console, "log"); - cy.exec('touch test/fixtures/**/*.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/*.css'); cy.wait(1000).then(() => { expect(spy.callCount).to.equal(2); const calls = new Set([spy.getCall(0).args.slice(-1)[0], spy.getCall(1).args.slice(-1)[0]]); diff --git a/cypress/integration/css-overlay-notify.js b/cypress/integration/css-overlay-notify.js index 0b7bb27d5..f29e02226 100644 --- a/cypress/integration/css-overlay-notify.js +++ b/cypress/integration/css-overlay-notify.js @@ -3,7 +3,7 @@ describe('CSS overlay notification', function() { cy.visit(Cypress.env('BS_URL')); }); it('should flash messages when css injected', function() { - cy.exec('touch test/fixtures/**/style.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/style.css'); cy.wait(500); cy.get('#__bs_notify__').should(function($elems) { expect($elems.length).to.equal(1); diff --git a/cypress/integration/file-reloading.js b/cypress/integration/file-reloading.js index 2174e37c2..4f293394f 100644 --- a/cypress/integration/file-reloading.js +++ b/cypress/integration/file-reloading.js @@ -4,14 +4,14 @@ describe('Reloading files', function() { cy.visit(Cypress.env('BS_URL')); }); it('should reload single ', function() { - cy.exec('touch test/fixtures/**/style.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/style.css'); cy.get('[id="css-style"]').should($link => { const url = new URL($link.attr('href')); expect(url.search).to.contain('?browsersync='); }); }); it('should reload 2 css files', function() { - cy.exec('touch test/fixtures/**/*.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/*.css'); cy.get('link').should($links => { $links.each((i, elem) => { const url = new URL(elem.href); @@ -57,7 +57,7 @@ describe('Reloading files', function() { const href = firstStyle.sheet.cssRules[0].href; expect(href).to.not.contain('?browsersync='); }); - cy.exec('touch test/fixtures/assets/import.css'); + cy.exec('touch packages/browser-sync/test/fixtures/assets/import.css'); cy.get('style').eq(0).should((style) => { const href = style[0].sheet.cssRules[0].href; expect(href).to.contain('?browsersync='); @@ -69,7 +69,7 @@ describe('Reloading files', function() { const href = doc.styleSheets[0].cssRules[0].href; expect(href).to.not.contain('?browsersync='); }); - cy.exec('touch test/fixtures/assets/import2.css'); + cy.exec('touch packages/browser-sync/test/fixtures/assets/import2.css'); cy.get('link').eq(0).should((link) => { const href = link[0].sheet.cssRules[0].href; expect(href).to.contain('?browsersync='); @@ -81,7 +81,7 @@ describe('Reloading files', function() { cy.visit(Cypress.env('BS_URL') + '/images.html'); }); it('should reload single ', function() { - cy.exec('touch test/fixtures/**/cam-secure.png'); + cy.exec('touch packages/browser-sync/test/fixtures/**/cam-secure.png'); cy.get('[id="img-src-attr"]').should($link => { const url = new URL($link.attr('src')); expect(url.search).to.contain('?browsersync='); @@ -93,7 +93,7 @@ describe('Reloading files', function() { }); }); it('should reload single style backgroundImage style property', function() { - cy.exec('touch test/fixtures/**/cam-secure-02.png'); + cy.exec('touch packages/browser-sync/test/fixtures/**/cam-secure-02.png'); cy.get('[id="img-src-attr"]').should($link => { expect($link.attr('src')).not.to.contain('?browsersync='); }); @@ -104,7 +104,7 @@ describe('Reloading files', function() { }); }); it('should reload both images', function() { - cy.exec('touch test/fixtures/**/*.png'); + cy.exec('touch packages/browser-sync/test/fixtures/**/*.png'); cy.get('[id="img-src-attr"]').should($link => { const url = new URL($link.attr('src')); expect(url.search).to.contain('?browsersync='); diff --git a/cypress/integration/file-watching-ignore.js b/cypress/integration/file-watching-ignore.js index d27e274f0..9c4db909f 100644 --- a/cypress/integration/file-watching-ignore.js +++ b/cypress/integration/file-watching-ignore.js @@ -4,7 +4,7 @@ describe('Watching folders', function() { cy.visit(Cypress.env('BS_URL') + '/bower.html'); }); it('should reload single ', function () { - cy.exec('touch test/fixtures/bower_components/app.css'); + cy.exec('touch packages/browser-sync/test/fixtures/bower_components/app.css'); cy.get('[id="css-style"]').should($link => { const url = new URL($link.attr('href')); expect(url.search).to.contain('?browsersync='); diff --git a/cypress/integration/logPrefix.js b/cypress/integration/logPrefix.js index f22dc5b83..3a466c882 100644 --- a/cypress/integration/logPrefix.js +++ b/cypress/integration/logPrefix.js @@ -12,7 +12,7 @@ describe('Connection notification (with logPrefix)', function() { it('should log prefixed message when css is injected', function() { cy.window().then((win) => { const spy = cy.spy(win.console, "log"); - cy.exec('touch test/fixtures/**/style.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/style.css'); cy.wait(1000).then(() => { expect(spy.getCall(0).args.slice(-1)[0]).to.equal('[LinkReplace] style.css'); expect(spy.getCall(0).args.indexOf('WSK') > -1).to.be.true; diff --git a/cypress/integration/no-notify.js b/cypress/integration/no-notify.js index c1ef72857..504f67924 100644 --- a/cypress/integration/no-notify.js +++ b/cypress/integration/no-notify.js @@ -7,7 +7,7 @@ describe('disabled notification', function() { cy.get('#__bs_notify__').should('have.length', 0); }); it('should not flash messages when css injected', function() { - cy.exec('touch test/fixtures/**/style.css'); + cy.exec('touch packages/browser-sync/test/fixtures/**/style.css'); cy.wait(500); cy.get('#__bs_notify__').should('have.length', 0); }); diff --git a/cypress/setup/bs.js b/cypress/setup/bs.js index 696e67d64..b17047223 100644 --- a/cypress/setup/bs.js +++ b/cypress/setup/bs.js @@ -13,7 +13,7 @@ module.exports = function(opts, ctx) { const json = require(join(ctx.config.cwd, opts.config)); return Observable.create(obs => { - const bs = require('../../').create(); + const bs = require('../../packages/browser-sync').create(); const instance = bs.init(json, function(err, bs) { if (err) { return obs.error(err); diff --git a/packages/browser-sync/crossbow.yaml b/packages/browser-sync/crossbow.yaml index 0f713bba5..2568164f5 100644 --- a/packages/browser-sync/crossbow.yaml +++ b/packages/browser-sync/crossbow.yaml @@ -36,37 +36,8 @@ tasks: --write --tab-width 4 cli: cypress/setup/bs-cli.js - bs: cypress/setup/bs.js options: - bs: - _default: - action: run - file-watching-ignore: - config: cypress/configs/file-watching-ignore.js - spec: cypress/integration/file-watching-ignore.js - file-reloading: - config: cypress/configs/file-reloading.js - spec: cypress/integration/file-reloading.js - no-notify: - config: cypress/configs/no-notify.js - spec: cypress/integration/no-notify.js - css-overlay: - config: cypress/configs/css-overlay-notify.js - spec: cypress/integration/css-overlay-notify.js - css-console-notify: - config: cypress/configs/css-console-notify.js - spec: cypress/integration/css-console-notify.js - connection-notify: - config: cypress/configs/file-reloading.js - spec: cypress/integration/connection-notify.js - log-prefix: - config: cypress/configs/logPrefix.js - spec: cypress/integration/logPrefix.js - ui-remote-debug: - config: cypress/configs/file-reloading.js - spec: cypress/integration/ui-remote-debug.js - cli: file-watching-ignore: method: 'run'