Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Feb 17, 2025
1 parent 939f5af commit b3a5157
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import type { Model } from '@ronin/syntax/schema';
* },
* });
*
* await add.account({ to: { email: 'mike@gmail.com' } });
* await add.account({ with: { email: 'mike@gmail.com' } });
*
* await remove.accounts.with.emailVerified.notBeing(true);
*
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/edge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('edge runtime', () => {
asyncContext: new AsyncLocalStorage(),
});

await factory.add.account({ to: { handle: 'leo' } });
await factory.add.account({ with: { handle: 'leo' } });
} catch (err) {
error = err as Error;
}
Expand Down
16 changes: 8 additions & 8 deletions tests/integration/factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ describe('factory', () => {
// schema types.
remove.accounts.with.emailVerified(false),
add.spaces({
to: { handle: 'test-space', members: ['member1', 'member2'] },
with: { handle: 'test-space', members: ['member1', 'member2'] },
}),
]) as Parameters<typeof batch>[0]);

expect(mockResolvedRequestText).toEqual(
'{"queries":[{"set":{"members":{"with":{"createdAt":{"lessThan":"2024-04-16T15:02:12.710Z"},"paid":true},"to":{"status":"active","activeFrom":"2024-04-16T15:02:12.710Z"}}}},{"get":{"accounts":{}}},{"count":{"spaces":{"with":{"membersCount":{"notBeing":0}}}}},{"remove":{"accounts":{"with":{"emailVerified":false}}}},{"add":{"spaces":{"to":{"handle":"test-space","members":["member1","member2"]}}}}]}',
'{"queries":[{"set":{"members":{"with":{"createdAt":{"lessThan":"2024-04-16T15:02:12.710Z"},"paid":true},"to":{"status":"active","activeFrom":"2024-04-16T15:02:12.710Z"}}}},{"get":{"accounts":{}}},{"count":{"spaces":{"with":{"membersCount":{"notBeing":0}}}}},{"remove":{"accounts":{"with":{"emailVerified":false}}}},{"add":{"spaces":{"with":{"handle":"test-space","members":["member1","member2"]}}}}]}',
);
});

Expand Down Expand Up @@ -391,7 +391,7 @@ describe('factory', () => {
});

await factory.add.account({
to: {
with: {
avatar: file,
},
});
Expand All @@ -410,7 +410,7 @@ describe('factory', () => {
expect(body).toBe(await file.text());

expect(mockResolvedRequestText).toEqual(
'{"queries":[{"add":{"account":{"to":{"avatar":{"key":"test-key","name":"example.jpeg","src":"https://storage.ronin.co/test-key","meta":{"height":100,"width":100,"size":100,"type":"image/jpeg"},"placeholder":{"base64":""}}}}}}]}',
'{"queries":[{"add":{"account":{"with":{"avatar":{"key":"test-key","name":"example.jpeg","src":"https://storage.ronin.co/test-key","meta":{"height":100,"width":100,"size":100,"type":"image/jpeg"},"placeholder":{"base64":""}}}}}}]}',
);
});

Expand Down Expand Up @@ -455,7 +455,7 @@ describe('factory', () => {
});

await factory.add.account({
to: {
with: {
avatar: file,
},
});
Expand Down Expand Up @@ -501,7 +501,7 @@ describe('factory', () => {
});

await factory.add.account({
to: {
with: {
video: file,
},
});
Expand All @@ -519,7 +519,7 @@ describe('factory', () => {
expect(body).toBe(await file.text());

expect(mockResolvedRequestText).toEqual(
'{"queries":[{"add":{"account":{"to":{"video":{"key":"test-key","name":"example.mp4","src":"https://storage.ronin.co/test-key","meta":{"size":100,"type":"video/mp4"},"placeholder":null}}}}}]}',
'{"queries":[{"add":{"account":{"with":{"video":{"key":"test-key","name":"example.mp4","src":"https://storage.ronin.co/test-key","meta":{"size":100,"type":"video/mp4"},"placeholder":null}}}}}]}',
);
});

Expand All @@ -536,7 +536,7 @@ describe('factory', () => {
});

const promise = factory.add.account({
to: {
with: {
avatar: new File([''], 'example.jpeg', { type: 'image/jpeg' }),
},
});
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ describe('hooks', () => {

hookInvoked = true;

await add.account.to({
await add.account.with({
handle: 'not-juri',
});

Expand All @@ -567,7 +567,7 @@ describe('hooks', () => {
asyncContext: new AsyncLocalStorage(),
});

const result = await add.account.to({
const result = await add.account.with({
handle: 'juri',
});

Expand All @@ -587,7 +587,7 @@ test('invoke `ronin` with `hooks` defined, but no `asyncContext` defined', async
},
});

await factory.add.account({ to: { handle: 'leo' } });
await factory.add.account({ with: { handle: 'leo' } });
} catch (err) {
error = err as Error;
}
Expand Down

0 comments on commit b3a5157

Please sign in to comment.