Skip to content

Commit a47b135

Browse files
committed
🔧 update pre-push and adjust callevent test
1 parent 3f7487f commit a47b135

File tree

2 files changed

+15
-41
lines changed

2 files changed

+15
-41
lines changed

.husky/pre-push

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
branch=$(
4+
v=$(git branch 2>/dev/null | grep "^*" | cut -d" " -f 2)
5+
test -z "$v" || echo $v
6+
)
7+
8+
. "$(dirname "$0")/_/husky.sh"
9+
10+
if [ "$branch" != "main" ]; then
11+
echo "Skipping pre-push on "$branch
12+
exit 0
13+
fi
14+
15+
npm run test

src/models/controller.model.test.ts

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -738,47 +738,6 @@ describe("updateCallEvent", () => {
738738
next = jest.fn();
739739
});
740740

741-
it("should ignore a call event with a remote direct dial", async () => {
742-
request = createRequest({
743-
providerConfig: {
744-
apiKey: "a1b2c3",
745-
apiUrl: "http://example.com",
746-
locale: "de_DE",
747-
},
748-
body: {
749-
participants: [
750-
{
751-
type: CallParticipantType.LOCAL,
752-
phoneNumber: "1234567890",
753-
},
754-
{
755-
type: CallParticipantType.REMOTE,
756-
phoneNumber: "13",
757-
},
758-
],
759-
id: "",
760-
startTime: 0,
761-
endTime: 0,
762-
direction: CallDirection.IN,
763-
note: "",
764-
state: CallState.BUSY,
765-
},
766-
});
767-
const controller: Controller = new Controller(
768-
{
769-
updateCallEvent: (config, id, event) => Promise.resolve(),
770-
},
771-
new StorageCache(new MemoryStorageAdapter())
772-
);
773-
774-
await controller.updateCallEvent(request, response, next);
775-
776-
const data: string = response._getData();
777-
778-
expect(next).not.toBeCalled();
779-
expect(data).toEqual("Skipping call event");
780-
});
781-
782741
it("should handle a call event", async () => {
783742
request = createRequest({
784743
providerConfig: {

0 commit comments

Comments
 (0)