sinonjs/sinon#1265
What: Feature request to automatically call stubbed/spied constructors with new.
Why: Often asked for. People get confused about Function#constructor and the constructor keyword.
Should either make a small tutorial to document how to "stub" (make a new) constructor
and/or introduce a small Sinon NPM plugin to do so (in the article).
This file contains hidden or 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
| const sinon = require('sinon'); | |
| const stub = sinon.stub(); | |
| const spy = sinon.spy(function(){}); | |
| function test(spy){ | |
| spy(1,2,3,4); | |
| spy(1,2); | |
| spy(1,2); | |
| spy(1); |
This file contains hidden or 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
| -- ref https://dba.stackexchange.com/questions/229725/how-to-utilize-an-index-when-filtering-a-view?noredirect=1#comment453204_229725 | |
| -- the comment from Akina seems to indicate that creating the view through this syntax should somehow | |
| -- affect the result? Very unsure if I understand the suggestion correctly. | |
| Drop table form2; | |
| CREATE TABLE form2 ( | |
| id INT, | |
| encounter_id INT NOT NULL, | |
| type TEXT NOT NULL, |
This file contains hidden or 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
| while we all know that using warm faucet water is not recommended in cooking, | |
| I just heard my mother-in-law state that you should only cook water and then mix | |
| it with cold water. The context was mixing water amd a baby porridge mix. | |
| I find this peculiar. | |
| What is difference in heating cold faucet water from just mixing cold faucet water and cooked water? | |
| They should be equally inviting to bacteria, AFAIK, but as it is for making something that is to | |
| be immediately consumed, I can't see any danger. |
This file contains hidden or 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
| // is called by google docs when a document is open | |
| // adds a menu with a menu item that applies a style to the currently selected text | |
| function onOpen() { | |
| DocumentApp.getUi() | |
| .createMenu('Extras') | |
| .addItem('Apply code style', 'applyCodeStyle') | |
| .addToUi(); | |
| } | |
| var backgroundColor = "#DDDDDD"; |
This file contains hidden or 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
| $ node | |
| > class A{ constructor(){ console.log('A normal super class'); } } | |
| undefined | |
| > class B extends A{} | |
| undefined | |
| > new B | |
| A normal super class | |
| B {} | |
| > sinon = require('sinon') | |
| ... |
This file contains hidden or 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
| #!/bin/sh | |
| # Usage example: ./edit_sinon_docs.sh stubs 4.1.1 | |
| # Will open stubs.md from 4.1.1 for editing and propagate the changes to later versions. | |
| # Make sure you have SINON_HOME pointing to the repository root. | |
| # You'll need git and the npm "semver" package installed (npm i -g semver) | |
| cd $SINON_HOME/docs | |
| FILENAME=$1.md |
Extracted from the internal jira issue tracker to keep a smaller footprint on the bug template.
- Check if you can reproduce the bug on the latest deployment of the development branch.
- Search the list of existing bugs to see if this has been already been reported.
- You can use JIRA markup for the formatting
This file contains hidden or 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
| Jun 19 17:20:46 e6330 wpa_supplicant[915]: wlp2s0: WPA: Group rekeying completed with ec:08:6b:ff:d3:bc [GTK=CCMP] | |
| Jun 19 17:28:26 e6330 pulseaudio[31070]: W: [pulseaudio] sink-input.c: Failed to create sink input: sink is suspended. | |
| Jun 19 17:28:41 e6330 NetworkManager[914]: <info> [1529422121.5642] manager: sleep: sleep requested (sleeping: no enabled: yes) | |
| Jun 19 17:28:41 e6330 NetworkManager[914]: <info> [1529422121.5710] manager: NetworkManager state is now ASLEEP | |
| Jun 19 17:28:41 e6330 gnome-shell[31045]: Screen lock is locked down, not locking | |
| Jun 19 17:28:41 e6330 gnome-shell[31045]: Failed to set power save mode for output LVDS-1: Permission denied | |
| Jun 19 17:28:41 e6330 NetworkManager[914]: <info> [1529422121.7631] device (wlp2s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed') | |
| Jun 19 17:28:41 e6330 NetworkManager[914]: <info> [1529422121.7950] device (wlp2s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed') | |
| Jun 1 |
This file contains hidden or 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
| const puppeteer = require("puppeteer"); | |
| const http = require("http"); | |
| const fs = require("fs"); | |
| const port = 3876; | |
| const scriptContent = ` | |
| import sinon from '/sinon-esm.js'; | |
| console.log('sinon is here', typeof sinon); |