Skip to content

Commit 7b9e000

Browse files
rearrange specs
just trying to group them in preparation for adding more specs with the new config options for scalars
1 parent 66683e1 commit 7b9e000

File tree

2 files changed

+181
-175
lines changed

2 files changed

+181
-175
lines changed

tests/scalars/__snapshots__/spec.ts.snap

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`should generate custom scalars for native and custom types using casual 1`] = `
3+
exports[`custom scalar generation for native and custom types using casual should generate custom scalars for native and custom types using casual 1`] = `
44
"
55
export const anA = (overrides?: Partial<A>): A => {
66
return {
@@ -27,66 +27,66 @@ export const aC = (overrides?: Partial<C>): C => {
2727
"
2828
`;
2929
30-
exports[`should generate custom scalars for native and custom types using faker 1`] = `
31-
"
30+
exports[`custom scalar generation for native and custom types using casual should generate dynamic custom scalars for native and custom types using casual 1`] = `
31+
"import casual from 'casual';
32+
33+
casual.seed(0);
34+
3235
export const anA = (overrides?: Partial<A>): A => {
3336
return {
34-
id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 83,
35-
str: overrides && overrides.hasOwnProperty('str') ? overrides.str! : 'Depereo nulla calco blanditiis cornu defetiscor.',
37+
id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : casual['integer'](...[1,100]),
38+
str: overrides && overrides.hasOwnProperty('str') ? overrides.str! : casual['string'],
3639
obj: overrides && overrides.hasOwnProperty('obj') ? overrides.obj! : aB(),
37-
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : '[email protected]',
40+
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : casual['email'],
3841
};
3942
};
4043
4144
export const aB = (overrides?: Partial<B>): B => {
4245
return {
43-
int: overrides && overrides.hasOwnProperty('int') ? overrides.int! : -93,
44-
flt: overrides && overrides.hasOwnProperty('flt') ? overrides.flt! : -24.51,
46+
int: overrides && overrides.hasOwnProperty('int') ? overrides.int! : casual['integer'](...[-100,0]),
47+
flt: overrides && overrides.hasOwnProperty('flt') ? overrides.flt! : casual['double'](...[-100,0]),
4548
bool: overrides && overrides.hasOwnProperty('bool') ? overrides.bool! : false,
4649
};
4750
};
4851
4952
export const aC = (overrides?: Partial<C>): C => {
5053
return {
51-
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : '[email protected]',
54+
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : casual['email'],
5255
};
5356
};
57+
58+
export const seedMocks = (seed: number) => casual.seed(seed);
5459
"
5560
`;
5661
57-
exports[`should generate dynamic custom scalars for native and custom types using casual 1`] = `
58-
"import casual from 'casual';
59-
60-
casual.seed(0);
61-
62+
exports[`custom scalar generation for native and custom types using faker should generate custom scalars for native and custom types using faker 1`] = `
63+
"
6264
export const anA = (overrides?: Partial<A>): A => {
6365
return {
64-
id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : casual['integer'](...[1,100]),
65-
str: overrides && overrides.hasOwnProperty('str') ? overrides.str! : casual['string'],
66+
id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 83,
67+
str: overrides && overrides.hasOwnProperty('str') ? overrides.str! : 'Depereo nulla calco blanditiis cornu defetiscor.',
6668
obj: overrides && overrides.hasOwnProperty('obj') ? overrides.obj! : aB(),
67-
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : casual['email'],
69+
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : '[email protected]',
6870
};
6971
};
7072
7173
export const aB = (overrides?: Partial<B>): B => {
7274
return {
73-
int: overrides && overrides.hasOwnProperty('int') ? overrides.int! : casual['integer'](...[-100,0]),
74-
flt: overrides && overrides.hasOwnProperty('flt') ? overrides.flt! : casual['double'](...[-100,0]),
75+
int: overrides && overrides.hasOwnProperty('int') ? overrides.int! : -93,
76+
flt: overrides && overrides.hasOwnProperty('flt') ? overrides.flt! : -24.51,
7577
bool: overrides && overrides.hasOwnProperty('bool') ? overrides.bool! : false,
7678
};
7779
};
7880
7981
export const aC = (overrides?: Partial<C>): C => {
8082
return {
81-
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : casual['email'],
83+
anyObject: overrides && overrides.hasOwnProperty('anyObject') ? overrides.anyObject! : '[email protected]',
8284
};
8385
};
84-
85-
export const seedMocks = (seed: number) => casual.seed(seed);
8686
"
8787
`;
8888
89-
exports[`should generate dynamic custom scalars for native and custom types using faker 1`] = `
89+
exports[`custom scalar generation for native and custom types using faker should generate dynamic custom scalars for native and custom types using faker 1`] = `
9090
"import { fakerEN as faker } from '@faker-js/faker';
9191
9292
faker.seed(0);

0 commit comments

Comments
 (0)