@lvce-editor/test-worker 15.4.0 → 15.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +3 -0
- package/dist/testWorkerMain.js +31 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -647,6 +647,7 @@ interface FileSystem {
|
|
|
647
647
|
readonly readFile: (uri: string) => Promise<string>;
|
|
648
648
|
readonly remove: (uri: string) => Promise<void>;
|
|
649
649
|
readonly setFiles: (files: readonly FileItem[]) => Promise<void>;
|
|
650
|
+
readonly shouldHaveFile: (uri: string, expectedContent: string) => Promise<void>;
|
|
650
651
|
readonly shouldHaveFolder: (uri: string) => Promise<void>;
|
|
651
652
|
readonly writeFile: (uri: string, content: string) => Promise<void>;
|
|
652
653
|
readonly writeJson: (uri: string, data: any) => Promise<void>;
|
|
@@ -685,7 +686,9 @@ interface Git {
|
|
|
685
686
|
readonly setConfig: (key: string, value: string) => Promise<void>;
|
|
686
687
|
readonly shouldHaveCommit: (message: string) => Promise<void>;
|
|
687
688
|
readonly shouldHaveInvocations: (invocations: readonly GitInvocation[]) => Promise<void>;
|
|
689
|
+
readonly stash: (message?: string) => Promise<void>;
|
|
688
690
|
readonly status: () => Promise<unknown>;
|
|
691
|
+
readonly unstash: () => Promise<void>;
|
|
689
692
|
}
|
|
690
693
|
|
|
691
694
|
interface IconTheme {
|
package/dist/testWorkerMain.js
CHANGED
|
@@ -1139,6 +1139,7 @@ const create = rpcId => {
|
|
|
1139
1139
|
};
|
|
1140
1140
|
|
|
1141
1141
|
const Directory = 3;
|
|
1142
|
+
const File = 7;
|
|
1142
1143
|
|
|
1143
1144
|
const Script$1 = 2;
|
|
1144
1145
|
|
|
@@ -3795,6 +3796,22 @@ const shouldHaveFolder = async uri => {
|
|
|
3795
3796
|
throw new AssertionError(`expected filesystem entry "${uri}" to be a folder but it was type ${matchingDirent.type}`);
|
|
3796
3797
|
}
|
|
3797
3798
|
};
|
|
3799
|
+
const shouldHaveFile = async (uri, expectedContent) => {
|
|
3800
|
+
const parentUri = getParentUri(uri);
|
|
3801
|
+
const fileName = getBaseName(uri);
|
|
3802
|
+
const dirents = await readDir(parentUri);
|
|
3803
|
+
const matchingDirent = dirents.find(dirent => dirent.name === fileName);
|
|
3804
|
+
if (!matchingDirent) {
|
|
3805
|
+
throw new AssertionError(`expected filesystem to have file "${uri}" but it was not found`);
|
|
3806
|
+
}
|
|
3807
|
+
if (matchingDirent.type !== File) {
|
|
3808
|
+
throw new AssertionError(`expected filesystem entry "${uri}" to be a file but it was type ${matchingDirent.type}`);
|
|
3809
|
+
}
|
|
3810
|
+
const actualContent = await readFile(uri);
|
|
3811
|
+
if (actualContent !== expectedContent) {
|
|
3812
|
+
throw new AssertionError(`expected file "${uri}" to have content "${expectedContent}" but got "${actualContent}"`);
|
|
3813
|
+
}
|
|
3814
|
+
};
|
|
3798
3815
|
const remove = async uri => {
|
|
3799
3816
|
await invoke('FileSystem.remove', uri);
|
|
3800
3817
|
};
|
|
@@ -3876,6 +3893,7 @@ const FileSystem = {
|
|
|
3876
3893
|
readFile,
|
|
3877
3894
|
remove,
|
|
3878
3895
|
setFiles,
|
|
3896
|
+
shouldHaveFile,
|
|
3879
3897
|
shouldHaveFolder,
|
|
3880
3898
|
writeFile,
|
|
3881
3899
|
writeJson
|
|
@@ -3972,6 +3990,16 @@ const pull = async (remote, branch) => {
|
|
|
3972
3990
|
const fetch$1 = async remote => {
|
|
3973
3991
|
await invoke('ExtensionHost.executeCommand', 'git.fetch', remote);
|
|
3974
3992
|
};
|
|
3993
|
+
const stash = async message => {
|
|
3994
|
+
if (message === undefined) {
|
|
3995
|
+
await invoke('ExtensionHost.executeCommand', 'git.stash');
|
|
3996
|
+
return;
|
|
3997
|
+
}
|
|
3998
|
+
await invoke('ExtensionHost.executeCommand', 'git.stash', message);
|
|
3999
|
+
};
|
|
4000
|
+
const unstash = async () => {
|
|
4001
|
+
await invoke('ExtensionHost.executeCommand', 'git.unstash');
|
|
4002
|
+
};
|
|
3975
4003
|
const checkout = async ref => {
|
|
3976
4004
|
await invoke('ExtensionHost.executeCommand', 'git.checkout', ref);
|
|
3977
4005
|
};
|
|
@@ -4026,7 +4054,9 @@ const Git = {
|
|
|
4026
4054
|
setConfig,
|
|
4027
4055
|
shouldHaveCommit,
|
|
4028
4056
|
shouldHaveInvocations,
|
|
4029
|
-
|
|
4057
|
+
stash,
|
|
4058
|
+
status,
|
|
4059
|
+
unstash
|
|
4030
4060
|
};
|
|
4031
4061
|
|
|
4032
4062
|
const setIconTheme = async id => {
|