Skip to content

Commit eb78e14

Browse files
authored
Set up CI with Azure Pipelines (#15)
* Set up CI with Azure Pipelines * Allow tests to fail correctly
1 parent 3002d3b commit eb78e14

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

azure-pipelines.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resources:
2+
containers:
3+
- container: dev1
4+
image: cypress/base:8
5+
jobs:
6+
- job: job_container
7+
pool:
8+
vmImage: 'ubuntu-16.04'
9+
container: dev1
10+
steps:
11+
- script: printenv
12+
- script: |
13+
yarn install
14+
displayName: 'install dependencies'
15+
- script: |
16+
yarn cypress verify
17+
displayName: 'Cypress verify'
18+
- script: |
19+
yarn test
20+
displayName: 'Run Cypress tests'

cypress/integration/example_spec.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ describe('pipe()', () => {
1414

1515
it('should show the function name in the Command Log', (done) => {
1616
const getFoo = subject => subject.foo
17+
const timeout = setTimeout(() => { done(new Error('Timed out waiting for log')) }, 1000)
1718
cy.on('log:added', (attrs, log) => {
1819
if (log.get('name') === 'pipe') {
1920
cy.removeAllListeners('log:added')
2021

2122
expect(log.get('message')).to.eq('getFoo')
2223
expect(log.get('name')).to.eq('pipe')
2324
expect(log.invoke('consoleProps')).to.have.property('Command', 'pipe')
25+
clearTimeout(timeout)
2426
done()
2527
}
2628
})
@@ -33,7 +35,7 @@ describe('pipe()', () => {
3335
const obj = { foo: 'bar' }
3436
setTimeout(() => { obj.foo = 'baz' }, delay)
3537
cy.wrap(obj)
36-
.pipe(subject => subject.foo)
38+
.pipe(subject => subject.foo)
3739
.should('equal', 'baz')
3840
})
3941

@@ -146,13 +148,15 @@ describe('pipe()', () => {
146148

147149
it('should show the function name in the Command Log', (done) => {
148150
const getFoo = subject => cy.wrap(subject.foo)
151+
const timeout = setTimeout(() => { done(new Error('Timed out waiting for log')) }, 1000)
149152
cy.on('log:added', (attrs, log) => {
150153
if (log.get('name') === 'pipe') {
151154
cy.removeAllListeners('log:added')
152155

153156
expect(log.get('message')).to.eq('getFoo')
154157
expect(log.get('name')).to.eq('pipe')
155158
expect(log.invoke('consoleProps')).to.have.property('Command', 'pipe')
159+
clearTimeout(timeout)
156160
done()
157161
}
158162
})

0 commit comments

Comments
 (0)