Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
CLAs look good, thanks! |
|
@Raphaeljunior, once #10671 is merged, the dependency errors on Travis should no longer be an issue. |
| "eslint": "3.18.0", | ||
| "eslint-plugin-google-camelcase": "0.0.2", | ||
| "express": "4.14.0", | ||
| "fetch-mock": "^5.12.1", |
There was a problem hiding this comment.
Can you also update yarn.lock by running yarn upgrade --save-dev and including the diffs in this PR?
/cc @erwinmombay
Edit: nvm, looks like you've done it in a new commit. Thanks.
There was a problem hiding this comment.
Don't use yarn upgrade, use yarn install.
There was a problem hiding this comment.
It's an error that happens on travis.
There was a problem hiding this comment.
Because you upgraded the yarn.lock to use unsupported versions. Revert changes to yarn.lock, then run yarn install and it'll work again.
# Conflicts: # yarn.lock
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
CLAs look good, thanks! |
|
@jridgewell PR ready for review. |
dreamofabear
left a comment
There was a problem hiding this comment.
Nice work! Two more things:
- Add some detail to the PR description -- what is the new default behavior? How do I use this new functionality?
- Revert package-lock.json since we haven't switched to using it from yarn.lock yet.
test/functional/test-xhrMock.js
Outdated
| /** | ||
| * @fileoverview | ||
| * Asserts xhr fetch has been mocked out and under control | ||
| **/ |
test/functional/test-xhrMock.js
Outdated
| @@ -0,0 +1,48 @@ | |||
| /** | |||
| * Copyright 2016 The AMP HTML Authors. All Rights Reserved. | |||
| import {setStyles} from '../src/style'; | ||
| import * as sinon from 'sinon'; | ||
|
|
||
| import fetchMock from 'fetch-mock'; |
testing/describes.js
Outdated
| * @param {{ | ||
| * win: !FakeWindowSpec, | ||
| * win: !FakeWindow | ||
| Spec, |
| * @param {string} name | ||
| * @param {!Object} spec | ||
| * @param {!Object} specconsole.log(fetchMock.sandbox()); | ||
| debugger; |
| env.expectFetch = function(url, response) { | ||
| return fetchMock.mock(url, response); | ||
| }; | ||
| } |
There was a problem hiding this comment.
Let's move this block of code to a top-level helper function to avoid code dupe.
| message: 'Use a sandbox instead to avoid repeated `#restore` calls', | ||
| }, | ||
| '(\\w*([sS]py|[sS]tub|[mM]ock|clock).restore)': { | ||
| '(\\w*([sS]py|[sS]tub|\\.[mM]ock|clock).restore)': { |
There was a problem hiding this comment.
To prevent the presubmit.js from blocking fetchMock.restore()
| @@ -1,4 +1,4 @@ | |||
| /** | |||
| /** | |||
| return initPromise.then(() => { | ||
| expect(noContentSpy).to.be.calledWith(false); | ||
| expect(iframeHandler.iframe).to.be.null; | ||
| done(); |
There was a problem hiding this comment.
This shouldn't be necessary since we're returning a Promise in the test.
| ampdoc: 'fie', | ||
| runtimeOn: false, | ||
| }, | ||
| xhrMock: false, |
There was a problem hiding this comment.
Nit: How about mockFetch? Sounds more like an action/verb.
|
@taymonbeal FYI, let us know if this works for you. |
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
Now that @Raphaeljunior has left, closing this and forking into #11001 since it's a huge pain to patch with conflicts and ~80 commits. |
Closes #10477