File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed
Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ /** @babel */
2+
3+ import { getDefinitions } from "../lib/goToDefinition" ;
4+
5+ // Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
6+ //
7+ // To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
8+ // or `fdescribe`). Remove the `f` to unfocus the block.
9+
10+ describe ( "go to definition" , ( ) => {
11+ describe ( "getDefinitions" , ( ) => {
12+ it ( "returns undefined if no provider exists for editor" , async ( ) => {
13+ const providerRegistry = {
14+ getProviderForEditor ( ) { }
15+ }
16+ const definitions = await getDefinitions ( providerRegistry , { editor : true , position : true } ) ;
17+ expect ( definitions ) . toBeUndefined ( ) ;
18+ } ) ;
19+ } ) ;
20+ } ) ;
Original file line number Diff line number Diff line change 1+ /** @babel */
2+
3+ import * as main from "../lib/main" ;
4+
5+ // Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.
6+ //
7+ // To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`
8+ // or `fdescribe`). Remove the `f` to unfocus the block.
9+
10+ describe ( "main" , ( ) => {
11+ it ( "activate" , async function ( ) {
12+ // Trigger deferred activation
13+ atom . packages . triggerDeferredActivationHooks ( ) ;
14+ // Activate activation hook
15+ atom . packages . triggerActivationHook ( "core:loaded-shell-environment" ) ;
16+
17+ await atom . packages . activatePackage ( "atom-ide-definitions" ) ;
18+ expect ( atom . packages . isPackageLoaded ( "atom-ide-definitions" ) ) . toBeTruthy ( ) ;
19+ } ) ;
20+
21+ it ( "getClickProvider" , ( ) => {
22+ const provider = main . getClickProvider ( ) ;
23+
24+ expect ( typeof provider . getSuggestionForWord ) . toEqual ( "function" ) ;
25+ } ) ;
26+ } ) ;
You can’t perform that action at this time.
0 commit comments