Skip to content

Commit

Permalink
lerna: more path updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Sep 17, 2018
1 parent 4ac3a49 commit c108af8
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 44 deletions.
31 changes: 31 additions & 0 deletions 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
2 changes: 1 addition & 1 deletion 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,
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/css-console-notify.js
Expand Up @@ -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');
})
Expand All @@ -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]]);
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/css-overlay-notify.js
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions cypress/integration/file-reloading.js
Expand Up @@ -4,14 +4,14 @@ describe('Reloading files', function() {
cy.visit(Cypress.env('BS_URL'));
});
it('should reload single <link>', 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);
Expand Down Expand Up @@ -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=');
Expand All @@ -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=');
Expand All @@ -81,7 +81,7 @@ describe('Reloading files', function() {
cy.visit(Cypress.env('BS_URL') + '/images.html');
});
it('should reload single <img src>', 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=');
Expand All @@ -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=');
});
Expand All @@ -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=');
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/file-watching-ignore.js
Expand Up @@ -4,7 +4,7 @@ describe('Watching folders', function() {
cy.visit(Cypress.env('BS_URL') + '/bower.html');
});
it('should reload single <link>', 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=');
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/logPrefix.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/no-notify.js
Expand Up @@ -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);
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/setup/bs.js
Expand Up @@ -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);
Expand Down
29 changes: 0 additions & 29 deletions packages/browser-sync/crossbow.yaml
Expand Up @@ -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'
Expand Down

0 comments on commit c108af8

Please sign in to comment.