-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t always add "defaultIgnorePatterns" - fixes #1543
- Loading branch information
1 parent
af79226
commit bdf99ba
Showing
12 changed files
with
128 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
server: 'test/fixtures', | ||
open: false, | ||
online: false, | ||
minify: false, | ||
files: 'test/fixtures', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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='); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const cypress = require('cypress'); | ||
const exec = require('child_process'); | ||
const assert = require('assert'); | ||
const {Observable} = require('rxjs/Observable'); | ||
|
||
module.exports = function(opts) { | ||
|
||
assert.ok(Array.isArray(opts.args), '`args` should be an array of strings'); | ||
assert.ok(opts.args.every(arg => typeof arg === 'string'), '`args` should contain only strings'); | ||
|
||
return Observable.create(obs => { | ||
const ls = exec.spawn('node', [ | ||
'dist/bin', | ||
...opts.args | ||
]); | ||
|
||
ls.stdout.once('data', (data) => { | ||
try { | ||
const parsed = JSON.parse(String(data)); | ||
const {urls} = parsed["service:running"].options; | ||
|
||
return cypress.run({ | ||
spec: opts.spec, | ||
env: `BS_URL=${urls.local}` | ||
}) | ||
.then((results) => { | ||
// stop your server when it's complete | ||
if (results.failures > 0) { | ||
return obs.error(new Error('failed!')); | ||
} | ||
obs.complete(); | ||
}) | ||
} catch (e) { | ||
console.error('Parsing Browsersync output failed', e); | ||
return obs.error(new Error('failed!')); | ||
} | ||
}); | ||
ls.stderr.on('data', (data) => { | ||
console.log(data); | ||
return obs.error(new Error('failed!')); | ||
}); | ||
return () => { | ||
ls.kill(); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<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" id="css-style" href="bower_components/app.css"> | ||
</head> | ||
<body> | ||
<h1>Bower Components</h1> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
body { | ||
background: orange; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters