Skip to content

Commit c4fe71a

Browse files
feat: Remove Cypress.moment() usage from examples (#470)
* feat: Remove Cypress.moment() usage from examples * Update Shippable record key which had been previously removed
1 parent ec5e9f1 commit c4fe71a

File tree

4 files changed

+1
-63
lines changed

4 files changed

+1
-63
lines changed

app/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ <h2>Utilities</h2>
266266
<li><a href="/utilities">$</a></li>
267267
<li><a href="/utilities">Blob</a></li>
268268
<li><a href="/utilities">minimatch</a></li>
269-
<li><a href="/utilities">moment</a></li>
270269
<li><a href="/utilities">Promise</a></li>
271270
</ul>
272271
</li>

app/utilities.html

-34
Original file line numberDiff line numberDiff line change
@@ -148,40 +148,6 @@ <h4 id="minimatch"><a href="https://on.cypress.io/minimatch">Cypress.minimatch</
148148

149149
<div class="col-xs-12"><hr></div>
150150

151-
<div class="col-xs-7">
152-
<h4 id="moment"><a href="https://on.cypress.io/moment">Cypress.moment()</a></h4>
153-
<p>To parse or format a date using a moment method, use the <a href="https://on.cypress.io/moment"><code>Cypress.moment()</code></a> command.</p>
154-
<pre><code class="javascript">const time = Cypress.moment().utc('2014-04-25T19:38:53.196Z').format('h:mm A')
155-
156-
cy.get('.utility-moment').contains('3:38 PM')
157-
.should('have.class', 'badge')
158-
159-
// the time in the element should be between 3pm and 5pm
160-
const start = Cypress.moment('3:00 PM', 'LT')
161-
const end = Cypress.moment('5:00 PM', 'LT')
162-
163-
cy.get('.utility-moment .badge')
164-
.should(($el) => {
165-
// parse American time like "3:38 PM"
166-
const m = Cypress.moment($el.text().trim(), 'LT')
167-
168-
// display hours + minutes + AM|PM
169-
const f = 'h:mm A'
170-
171-
expect(m.isBetween(start, end),
172-
`${m.format(f)} should be between ${start.format(f)} and ${end.format(f)}`).to.be.true
173-
})</code></pre>
174-
</div>
175-
<div class="col-xs-5">
176-
<div class="well">
177-
<div class="utility-moment"> Posted at
178-
<span class="badge badge-primary">3:38 PM</span>
179-
</div>
180-
</div>
181-
</div>
182-
183-
<div class="col-xs-12"><hr></div>
184-
185151
<div class="col-xs-12">
186152
<h4 id="Promise"><a href="https://on.cypress.io/promise">Cypress.Promise</a></h4>
187153
<p>To instantiate a new bluebird promise, use <a href="https://on.cypress.io/promise"><code> Cypress.Promise</code></a>.</p>

cypress/integration/examples/utilities.spec.js

-26
Original file line numberDiff line numberDiff line change
@@ -76,32 +76,6 @@ context('Utilities', () => {
7676
expect(matching, 'comments').to.be.false
7777
})
7878

79-
it('Cypress.moment() - format or parse dates using a moment method', () => {
80-
// https://on.cypress.io/moment
81-
const time = Cypress.moment('2014-04-25T19:38:53.196Z').utc().format('h:mm A')
82-
83-
expect(time).to.be.a('string')
84-
85-
cy.get('.utility-moment').contains('3:38 PM')
86-
.should('have.class', 'badge')
87-
88-
// the time in the element should be between 3pm and 5pm
89-
const start = Cypress.moment('3:00 PM', 'LT')
90-
const end = Cypress.moment('5:00 PM', 'LT')
91-
92-
cy.get('.utility-moment .badge')
93-
.should(($el) => {
94-
// parse American time like "3:38 PM"
95-
const m = Cypress.moment($el.text().trim(), 'LT')
96-
97-
// display hours + minutes + AM|PM
98-
const f = 'h:mm A'
99-
100-
expect(m.isBetween(start, end),
101-
`${m.format(f)} should be between ${start.format(f)} and ${end.format(f)}`).to.be.true
102-
})
103-
})
104-
10579
it('Cypress.Promise - instantiate a bluebird promise', () => {
10680
// https://on.cypress.io/promise
10781
let waited = false

shippable.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
env:
1212
# the record key should be secret, thus it is encrypted
1313
# http://docs.shippable.com/ci/env-vars/
14-
- secure: BVEpGDVa62Pc2fJzblIbkUifF207qfQMMial+KYkp0KlcVtF/WT12jFQ6N6fNGQSZc8op2E+K/OnTFI3Lo6NueD85wHy6PZiHTgrAzFjCZpMksyY7Pu/n7SKQk1yVS9rTNqtdTdRoXGTDX3DgVErBYeTYv7/uyH5sL4/HiS7Y2iuEkXV30X6K6Qx/D3zH/EXZARwJoIk88xliJW9hkqP1UKAeOS4tuBY/ADQ0gxi8bi4Io1N+rQ+QZRHm8Buur5PnVLIQhwL7nS7mLUJvXTZOThqYLJ4P/9E6CBX1gviwQLo4KvyExv9zc18gyX5pJ/16fl94dKIJ6518EKPY6xRFQ==
15-
14+
- secure: N5+kC/lvCYBZPfneXH87gfwxkY0KzAuRrISAC3kKfGY9+NCRU7gHYdDq0c/Uh5GeBMZlvmUAlu+8b94qrwImm6jm1/w7LN/E9gey+SX6NdHkya5j8gW+n3Eiw8Z36at4KxIOyIDCL/6ZtmsM7fSS/iUfVHDvRw/ZnGKYBYuyG0emsgyZbx4Hmb0usSv1mJkwCN3FYML82DwUyi5fYwrkMQ4gssgUoWBWVXxFW+UdoA2wXrAvH19NF0awy1ZKFdLc18IjcScz7HMPALigDCLeyprrvQqwXJ5tNPRf0ClfP1bIPNKxRM/Cgj0Jnooh1RgevHbCtwjKpOHHWcZth8SbQw==
1615
build:
1716
# note: you can use custom Docker image with Shippable, see
1817
# http://docs.shippable.com/ci/custom-docker-image/

0 commit comments

Comments
 (0)