Skip to content

Commit 2aeb944

Browse files
committed
Simplify toJSON test
1 parent 1534374 commit 2aeb944

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

src/types/__tests__/VariableType.tests.ts

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,35 +43,12 @@ describe('VariableType()', () => {
4343
}`);
4444
});
4545

46-
it('properly ads dollar sign on JSON.stringify', () => {
47-
const query = {
48-
query: {
49-
__variables: {
50-
someString: 'String!',
51-
varWithDefault: 'String = "default_value"'
52-
},
53-
Posts: {
54-
__args: {
55-
arg1: 20,
56-
arg2: new VariableType('someString')
57-
},
58-
id: true,
59-
title: true,
60-
comments: {
61-
__args: {
62-
offensiveOnly: true
63-
},
64-
id: true,
65-
comment: true,
66-
user: true
67-
}
68-
}
69-
}
46+
it('Returns variable name prefixed with a dollar sign with JSON.stringify', () => {
47+
const args = {
48+
arg2: new VariableType('someString')
7049
};
71-
expect(JSON.stringify(query)).to.equal(
72-
'{"query":{"__variables":{"someString":"String!","varWithDefault":"String = \\"default_value\\""},'
73-
+ '"Posts":{"__args":{"arg1":20,"arg2":"$someString"},"id":true,"title":true,"comments":'
74-
+ '{"__args":{"offensiveOnly":true},"id":true,"comment":true,"user":true}}}}'
50+
expect(JSON.stringify(args)).to.equal(
51+
'{"arg2":"$someString"}'
7552
);
7653
});
7754

0 commit comments

Comments
 (0)