-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Extensions that still use these APIs can not be tested anymore with this version of the stubs.
- Loading branch information
1 parent
b671c17
commit db9cd63
Showing
3 changed files
with
12 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { Subscription } from 'rxjs' | ||
import * as sinon from 'sinon' | ||
import { ExtensionContext } from 'sourcegraph' | ||
import { assertTypeIsCompatible } from './util' | ||
import { subTypeOf } from './util' | ||
|
||
export const createStubExtensionContext = () => { | ||
const subscriptions = sinon.stub(new Subscription()) | ||
subscriptions.add.callThrough() | ||
subscriptions.remove.callThrough() | ||
subscriptions.unsubscribe.callThrough() | ||
const context = { | ||
const context = subTypeOf<ExtensionContext>()({ | ||
subscriptions, | ||
} | ||
assertTypeIsCompatible<ExtensionContext>(context) | ||
}) | ||
return context | ||
} |
This file contains 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