I hereby claim:
- I am rickhanlonii on github.
- I am rickhanlonii (https://keybase.io/rickhanlonii) on keybase.
- I have a public key ASChr2UUJm_gA-01WTq5vrL2tZQS8MJD6C1VKGtLke8kJAo
To claim this, I am signing this object:
| import notifs | |
| def print_notification(title, message): | |
| print "Notification received: {0}: {1}".format(title, message) | |
| def web_app_notify(title, message): | |
| print "Webapp notification received: {0}: {1}".format(title, message) | |
| def iphone_app_notify(title, message): | |
| print "iPhone App notification received: {0}: {1}".format(title, message) |
| . |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- This policy is broken --> | |
| <meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-inline'"> | |
| <!-- This policy works --> | |
| <!--<meta http-equiv="Content-Security-Policy" content="script-src * 'unsafe-inline' 'unsafe-eval">--> | |
| <script src="https://code.jquery.com/jquery-2.2.1.min.js" integrity="sha256-gvQgAFzTH6trSrAWoH1iPo9Xc96QxSZ3feW6kem+O00=" crossorigin="anonymous"></script> |
I hereby claim:
To claim this, I am signing this object:
| { | |
| "/Users/rph/dev/oss/jest-coverage-leak/module.js": { | |
| "path": "/Users/rph/dev/oss/jest-coverage-leak/module.js", | |
| "statementMap": { | |
| "0": { | |
| "start": { | |
| "line": 1, | |
| "column": 13 | |
| }, | |
| "end": { |
| test("returns undefined by default", () => { | |
| const mock = jest.fn(); | |
| let result = mock("foo"); | |
| expect(result).toBeUndefined(); | |
| expect(mock).toHaveBeenCalled(); | |
| expect(mock).toHaveBeenCalledTimes(1); | |
| expect(mock).toHaveBeenCalledWith("foo"); | |
| }); |
| test("mock implementation", () => { | |
| const mock = jest.fn(() => "bar"); | |
| expect(mock("foo")).toBe("bar"); | |
| expect(mock).toHaveBeenCalledWith("foo"); | |
| }); | |
| test("also mock implementation", () => { | |
| const mock = jest.fn().mockImplementation(() => "bar"); |
| const doAdd = (a, b, callback) => { | |
| callback(a + b); | |
| }; | |
| test("calls callback with arguments added", () => { | |
| const mockCallback = jest.fn(); | |
| doAdd(1, 2, mockCallback); | |
| expect(mockCallback).toHaveBeenCalledWith(3); | |
| }); |
├ example/
| └── app.js
| └── app.test.js
| └── math.js