Skip to content

Commit

Permalink
WIP adding tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed May 2, 2018
1 parent 5110199 commit be2ab18
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
4 changes: 4 additions & 0 deletions crossbow.yaml
Expand Up @@ -16,6 +16,10 @@ tasks:
- cypress:*

(cypress):
file-watching-ignore: >
@npm node cypress/setup/run.js
'../configs/file-watching-ignore.js'
cypress/integration/file-watching-ignore.js
file-reloading: >
@npm node cypress/setup/run.js
'../configs/file-reloading.js'
Expand Down
7 changes: 7 additions & 0 deletions cypress/configs/file-watching-ignore.js
@@ -0,0 +1,7 @@
module.exports = {
server: 'test/fixtures',
open: false,
online: false,
minify: false,
files: 'test/fixtures',
};
14 changes: 14 additions & 0 deletions cypress/integration/file-watching-ignore.js
@@ -0,0 +1,14 @@
describe('Watching folders', function() {
context('files option', function () {
beforeEach(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.get('[id="css-style"]').should($link => {
const url = new URL($link.attr('href'));
expect(url.search).to.contain('?browsersync=');
});
});
});
});
2 changes: 1 addition & 1 deletion test/fixtures/bower.html
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="bower_components/app.css">
<link rel="stylesheet" id="css-style" href="bower_components/app.css">
</head>
<body>
<h1>Bower Components</h1>
Expand Down

0 comments on commit be2ab18

Please sign in to comment.