mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
feat: Make webpack configuration trigger linkable-push
Previously this was done by lens-webpack-build, which is awkward for build-scripts that watch. Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
1 parent
0c1e822788
commit
0c2cc25b5b
5 files changed
+20
-64
No files matched your search
@@ -51,68 +51,10 @@ describe("do-webpack-build", () => {
|
||||
expect(logSuccessMock).toHaveBeenCalledWith("some-stdout");
|
||||
});
|
||||
|
||||
it("makes the built package available for local packages in development that link to it", () => {
|
||||
expect(execMock).toHaveBeenCalledWith("linkable-push");
|
||||
});
|
||||
|
||||
it("does not finish script yet", async () => {
|
||||
it("script is done", async () => {
|
||||
const promiseStatus = await getPromiseStatus(actualPromise);
|
||||
|
||||
expect(promiseStatus.fulfilled).toBe(false);
|
||||
});
|
||||
|
||||
describe("when linking resolves with stdout", () => {
|
||||
beforeEach(async () => {
|
||||
logSuccessMock.mockClear();
|
||||
|
||||
await execMock.resolve({ stdout: "some-other-stdout", stderr: "" });
|
||||
});
|
||||
|
||||
it("logs the stdout", () => {
|
||||
expect(logSuccessMock).toHaveBeenCalledWith("some-other-stdout");
|
||||
});
|
||||
|
||||
it("script finishes", async () => {
|
||||
const promiseStatus = await getPromiseStatus(actualPromise);
|
||||
|
||||
expect(promiseStatus.fulfilled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when linking resolves with stderr", () => {
|
||||
beforeEach(() => {
|
||||
logSuccessMock.mockClear();
|
||||
|
||||
execMock.resolve({ stdout: "", stderr: "some-other-stderr" });
|
||||
});
|
||||
|
||||
it("does not log success", () => {
|
||||
actualPromise.catch(() => {});
|
||||
|
||||
expect(logSuccessMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("logs a warning", () => {
|
||||
expect(logWarningMock).toBeCalledWith("Warning while executing \"linkable-push\": some-other-stderr");
|
||||
});
|
||||
});
|
||||
|
||||
describe("when linking rejects", () => {
|
||||
beforeEach(() => {
|
||||
logSuccessMock.mockClear();
|
||||
|
||||
execMock.reject(new Error("some-other-error"));
|
||||
});
|
||||
|
||||
it("does not log success", () => {
|
||||
actualPromise.catch(() => {});
|
||||
|
||||
expect(logSuccessMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("throws", () => {
|
||||
return expect(actualPromise).rejects.toThrow("some-other-error");
|
||||
});
|
||||
expect(promiseStatus.fulfilled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -25,8 +25,6 @@ export const doWebpackBuildInjectable = getInjectable({
|
||||
|
||||
return async () => {
|
||||
await execWithResultHandling("webpack");
|
||||
|
||||
await execWithResultHandling("linkable-push");
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user