@lvce-editor/test-worker 15.4.0 → 15.6.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 +13 -0
- package/dist/testWorkerMain.js +71 -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>;
|
|
@@ -675,17 +676,29 @@ interface Git {
|
|
|
675
676
|
readonly addRemote: (name: string, remoteUrl: string) => Promise<void>;
|
|
676
677
|
readonly branch: (name: string) => Promise<void>;
|
|
677
678
|
readonly checkout: (ref: string) => Promise<void>;
|
|
679
|
+
readonly cherryPick: (commitHash: string) => Promise<void>;
|
|
678
680
|
readonly clone: (repositoryUrl: string, cwd: string) => Promise<void>;
|
|
679
681
|
readonly commit: (message: string) => Promise<void>;
|
|
680
682
|
readonly config: (values: Record<string, string>) => Promise<void>;
|
|
683
|
+
readonly createTag: (name: string) => Promise<void>;
|
|
684
|
+
readonly deleteBranch: (name: string) => Promise<void>;
|
|
685
|
+
readonly deleteTag: (name: string) => Promise<void>;
|
|
681
686
|
readonly fetch: (remote: string) => Promise<void>;
|
|
687
|
+
readonly fetchAll: () => Promise<void>;
|
|
688
|
+
readonly fetchPrune: () => Promise<void>;
|
|
682
689
|
readonly init: (options?: GitInitOptions) => Promise<void>;
|
|
690
|
+
readonly merge: (ref: string) => Promise<void>;
|
|
683
691
|
readonly pull: (remote: string, branch: string) => Promise<void>;
|
|
684
692
|
readonly push: (remoteOrOptions?: string | GitPushOptions, branch?: string) => Promise<void>;
|
|
693
|
+
readonly rebase: (ref: string) => Promise<void>;
|
|
694
|
+
readonly removeRemote: (name: string) => Promise<void>;
|
|
695
|
+
readonly renameBranch: (newName: string) => Promise<void>;
|
|
685
696
|
readonly setConfig: (key: string, value: string) => Promise<void>;
|
|
686
697
|
readonly shouldHaveCommit: (message: string) => Promise<void>;
|
|
687
698
|
readonly shouldHaveInvocations: (invocations: readonly GitInvocation[]) => Promise<void>;
|
|
699
|
+
readonly stash: (message?: string) => Promise<void>;
|
|
688
700
|
readonly status: () => Promise<unknown>;
|
|
701
|
+
readonly unstash: () => Promise<void>;
|
|
689
702
|
}
|
|
690
703
|
|
|
691
704
|
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,18 +3990,58 @@ 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 fetchAll = async () => {
|
|
3994
|
+
await invoke('ExtensionHost.executeCommand', 'git.fetchAll');
|
|
3995
|
+
};
|
|
3996
|
+
const fetchPrune = async () => {
|
|
3997
|
+
await invoke('ExtensionHost.executeCommand', 'git.fetchPrune');
|
|
3998
|
+
};
|
|
3999
|
+
const stash = async message => {
|
|
4000
|
+
if (message === undefined) {
|
|
4001
|
+
await invoke('ExtensionHost.executeCommand', 'git.stash');
|
|
4002
|
+
return;
|
|
4003
|
+
}
|
|
4004
|
+
await invoke('ExtensionHost.executeCommand', 'git.stash', message);
|
|
4005
|
+
};
|
|
4006
|
+
const unstash = async () => {
|
|
4007
|
+
await invoke('ExtensionHost.executeCommand', 'git.unstash');
|
|
4008
|
+
};
|
|
3975
4009
|
const checkout = async ref => {
|
|
3976
4010
|
await invoke('ExtensionHost.executeCommand', 'git.checkout', ref);
|
|
3977
4011
|
};
|
|
3978
4012
|
const branch = async name => {
|
|
3979
4013
|
await invoke('ExtensionHost.executeCommand', 'git.branch', name);
|
|
3980
4014
|
};
|
|
4015
|
+
const deleteBranch = async name => {
|
|
4016
|
+
await invoke('ExtensionHost.executeCommand', 'git.deleteBranch', name);
|
|
4017
|
+
};
|
|
4018
|
+
const renameBranch = async newName => {
|
|
4019
|
+
await invoke('ExtensionHost.executeCommand', 'git.renameBranch', newName);
|
|
4020
|
+
};
|
|
4021
|
+
const cherryPick = async commitHash => {
|
|
4022
|
+
await invoke('ExtensionHost.executeCommand', 'git.cherryPick', commitHash);
|
|
4023
|
+
};
|
|
4024
|
+
const merge = async ref => {
|
|
4025
|
+
await invoke('ExtensionHost.executeCommand', 'git.merge', ref);
|
|
4026
|
+
};
|
|
4027
|
+
const rebase = async ref => {
|
|
4028
|
+
await invoke('ExtensionHost.executeCommand', 'git.rebase', ref);
|
|
4029
|
+
};
|
|
4030
|
+
const createTag = async name => {
|
|
4031
|
+
await invoke('ExtensionHost.executeCommand', 'git.createTag', name);
|
|
4032
|
+
};
|
|
4033
|
+
const deleteTag = async name => {
|
|
4034
|
+
await invoke('ExtensionHost.executeCommand', 'git.deleteTag', name);
|
|
4035
|
+
};
|
|
3981
4036
|
const status = async () => {
|
|
3982
4037
|
return invoke('ExtensionHost.executeCommand', 'git.status');
|
|
3983
4038
|
};
|
|
3984
4039
|
const addRemote = async (name, remoteUrl) => {
|
|
3985
4040
|
await invoke('ExtensionHost.executeCommand', 'git.addRemote', name, remoteUrl);
|
|
3986
4041
|
};
|
|
4042
|
+
const removeRemote = async name => {
|
|
4043
|
+
await invoke('ExtensionHost.executeCommand', 'git.removeRemote', name);
|
|
4044
|
+
};
|
|
3987
4045
|
const setConfig = async (key, value) => {
|
|
3988
4046
|
await invoke('ExtensionHost.executeCommand', 'git.setConfig', key, value);
|
|
3989
4047
|
};
|
|
@@ -4016,17 +4074,29 @@ const Git = {
|
|
|
4016
4074
|
addRemote,
|
|
4017
4075
|
branch,
|
|
4018
4076
|
checkout,
|
|
4077
|
+
cherryPick,
|
|
4019
4078
|
clone,
|
|
4020
4079
|
commit,
|
|
4021
4080
|
config,
|
|
4081
|
+
createTag,
|
|
4082
|
+
deleteBranch,
|
|
4083
|
+
deleteTag,
|
|
4022
4084
|
fetch: fetch$1,
|
|
4085
|
+
fetchAll,
|
|
4086
|
+
fetchPrune,
|
|
4023
4087
|
init,
|
|
4088
|
+
merge,
|
|
4024
4089
|
pull,
|
|
4025
4090
|
push: push$1,
|
|
4091
|
+
rebase,
|
|
4092
|
+
removeRemote,
|
|
4093
|
+
renameBranch,
|
|
4026
4094
|
setConfig,
|
|
4027
4095
|
shouldHaveCommit,
|
|
4028
4096
|
shouldHaveInvocations,
|
|
4029
|
-
|
|
4097
|
+
stash,
|
|
4098
|
+
status,
|
|
4099
|
+
unstash
|
|
4030
4100
|
};
|
|
4031
4101
|
|
|
4032
4102
|
const setIconTheme = async id => {
|