-
Notifications
You must be signed in to change notification settings - Fork 274
/
ExtHostBufferOpenTest.re
41 lines (35 loc) · 1.16 KB
/
ExtHostBufferOpenTest.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
open Oni_Model;
open Oni_IntegrationTestLib;
module TS = TextSynchronization;
// This test validates:
// - The 'oni-dev' extension gets activated
// - When typing in an 'oni-dev' buffer, the buffer received by the extension host
// is in sync with the buffer in the main process
runTestWithInput(
~name="ExtHostBufferOpen", (_input, dispatch, wait, _runEffects) => {
wait(~name="Capture initial state", (state: State.t) =>
Feature_Vim.mode(state.vim) == Vim.Mode.Normal
);
// Wait until the extension is activated
// Give some time for the exthost to start
wait(
~timeout=30.0,
~name="Validate the 'oni-dev' extension gets activated",
(state: State.t) =>
List.exists(
id => id == "oni-dev-extension",
state.extensions |> Feature_Extensions.activatedIds,
)
);
let testFile = getAssetPath("some-test-file.txt");
// Open an erroneous CSS file - verify we get some diagnostics
dispatch(Actions.OpenFileByPath(testFile, None, None));
let () =
TS.validateTextIsSynchronized(
~expectedText=Some("abc| def| ghi|"),
~description="Validate text model is consistent",
dispatch,
wait,
);
();
});