Skip to content

Commit

Permalink
npmignore update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobris committed Jan 25, 2021
1 parent 0dbd493 commit 1072e8a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ bbExamples/
LICENSE.md
logo.png
README.md
.gitattributes
8 changes: 4 additions & 4 deletions spec/createContext.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe("createContext", () => {
ctxClass: NestedCtx,
render(ctx: NestedCtx) {
expect(ctx.contextValue).toBe(ctx.data.value);
}
},
});

interface IOuterData {
Expand All @@ -89,7 +89,7 @@ describe("createContext", () => {
render(ctx: OuterCtx, me: b.IBobrilNode) {
if (ctx.data.value != undefined) ctx.contextValue = ctx.data.value;
me.children = <Nested value={ctx.data.test} />;
}
},
});

b.init(() => <Outer test={42} />);
Expand All @@ -104,7 +104,7 @@ describe("createContext", () => {
const Nested = b.createComponent<{ value: number }>({
render(ctx: b.IBobrilCtx<{ value: number }>) {
expect(b.useContext(myContext)).toBe(ctx.data.value);
}
},
});

interface IOuterData {
Expand All @@ -116,7 +116,7 @@ describe("createContext", () => {
render(ctx: b.IBobrilCtx<IOuterData>, me: b.IBobrilNode) {
if (ctx.data.value != undefined) b.useProvideContext(myContext, ctx.data.value);
me.children = <Nested value={ctx.data.test} />;
}
},
});

b.init(() => Outer({ test: 42 }));
Expand Down
34 changes: 17 additions & 17 deletions spec/useEvents.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,63 @@ describe("useEvents", () => {

function Two({ id }: { id: string }) {
b.useEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "Two1";
return b.EventResult.NotHandled;
}
},
});
b.useEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "Two2";
return b.EventResult.NotHandled;
}
},
});
b.useCaptureEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "CTwo1";
return b.EventResult.NotHandled;
}
},
});
b.useCaptureEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "CTwo2";
return b.EventResult.NotHandled;
}
},
});
return <span id={id}>2</span>;
}
function One() {
b.useEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "One1";
return b.EventResult.NotHandled;
}
},
});
b.useEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "One2";
return b.EventResult.NotHandled;
}
},
});
b.useCaptureEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "COne1";
return b.EventResult.NotHandled;
}
},
});
b.useCaptureEvents({
onClick: param => {
onClick: (param) => {
expect(param.target.attrs!.id).toBe("here");
called += "COne2";
return b.EventResult.NotHandled;
}
},
});
return (
<>
Expand All @@ -82,7 +82,7 @@ describe("useEvents", () => {
meta: false,
shift: false,
x: 10,
y: 20
y: 20,
});
expect(called).toBe("COne1COne2CTwo1CTwo2CTwo1CTwo2Two1Two2One1One2");
});
Expand Down
6 changes: 3 additions & 3 deletions spec/useStore.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ describe("useStore", () => {
it("store is disposed", () => {
const spiedDispose = jasmine.createSpy("dispose");
const store = {
dispose: spiedDispose
}
const id = b.addRoot(() => <TestComponent factory={() => store} />)
dispose: spiedDispose,
};
const id = b.addRoot(() => <TestComponent factory={() => store} />);
b.syncUpdate();
b.removeRoot(id);
expect(spiedDispose).toHaveBeenCalled();
Expand Down

0 comments on commit 1072e8a

Please sign in to comment.