fork of hey-api/openapi-ts because I need some additional things
at feat/skip-token 154 lines 3.9 kB view raw
1// import { createClient } from './index'; 2 3// type Config = Parameters<typeof createClient>[0]; 4 5describe('createClient', () => { 6 it('works', () => { 7 expect(true).toBe(true); 8 }); 9 // it('1 config, 1 input, 1 output', async () => { 10 // const config: Config = { 11 // dryRun: true, 12 // input: { 13 // info: { title: 'foo', version: '1.0.0' }, 14 // openapi: '3.0.0', 15 // }, 16 // logs: { 17 // level: 'silent', 18 // }, 19 // output: 'output', 20 // plugins: ['@hey-api/sdk'], 21 // }; 22 23 // const results = await createClient(config); 24 // expect(results).toHaveLength(1); 25 // }); 26 27 // it('1 config, 2 inputs, 1 output', async () => { 28 // const config: Config = { 29 // dryRun: true, 30 // input: [ 31 // { 32 // info: { title: 'foo', version: '1.0.0' }, 33 // openapi: '3.0.0', 34 // }, 35 // { 36 // info: { title: 'bar', version: '1.0.0' }, 37 // openapi: '3.0.0', 38 // paths: {}, 39 // }, 40 // ], 41 // logs: { 42 // level: 'silent', 43 // }, 44 // output: 'output', 45 // plugins: ['@hey-api/sdk'], 46 // }; 47 48 // const results = await createClient(config); 49 // expect(results).toHaveLength(1); 50 // }); 51 52 // it('1 config, 2 inputs, 2 outputs', async () => { 53 // const config: Config = { 54 // dryRun: true, 55 // input: [ 56 // { 57 // info: { title: 'foo', version: '1.0.0' }, 58 // openapi: '3.0.0', 59 // }, 60 // { 61 // info: { title: 'bar', version: '1.0.0' }, 62 // openapi: '3.0.0', 63 // paths: {}, 64 // }, 65 // ], 66 // logs: { 67 // level: 'silent', 68 // }, 69 // output: ['output', 'output2'], 70 // plugins: ['@hey-api/sdk'], 71 // }; 72 73 // const results = await createClient(config); 74 // expect(results).toHaveLength(2); 75 // }); 76 77 // it('2 configs, 1 input, 1 output', async () => { 78 // const config: Config = [ 79 // { 80 // dryRun: true, 81 // input: { 82 // info: { title: 'foo', version: '1.0.0' }, 83 // openapi: '3.0.0', 84 // }, 85 // logs: { 86 // level: 'silent', 87 // }, 88 // output: 'output', 89 // plugins: ['@hey-api/sdk'], 90 // }, 91 // { 92 // dryRun: true, 93 // input: { 94 // info: { title: 'bar', version: '1.0.0' }, 95 // openapi: '3.0.0', 96 // }, 97 // logs: { 98 // level: 'silent', 99 // }, 100 // output: 'output2', 101 // plugins: ['@hey-api/sdk'], 102 // }, 103 // ]; 104 105 // const results = await createClient(config); 106 // expect(results).toHaveLength(2); 107 // }); 108 109 // it('2 configs, 2 inputs, 2 outputs', async () => { 110 // const config: Config = [ 111 // { 112 // dryRun: true, 113 // input: [ 114 // { 115 // info: { title: 'foo', version: '1.0.0' }, 116 // openapi: '3.0.0', 117 // }, 118 // { 119 // info: { title: 'bar', version: '1.0.0' }, 120 // openapi: '3.0.0', 121 // paths: {}, 122 // }, 123 // ], 124 // logs: { 125 // level: 'silent', 126 // }, 127 // output: ['output', 'output2'], 128 // plugins: ['@hey-api/sdk'], 129 // }, 130 // { 131 // dryRun: true, 132 // input: [ 133 // { 134 // info: { title: 'baz', version: '1.0.0' }, 135 // openapi: '3.0.0', 136 // }, 137 // { 138 // info: { title: 'qux', version: '1.0.0' }, 139 // openapi: '3.0.0', 140 // paths: {}, 141 // }, 142 // ], 143 // logs: { 144 // level: 'silent', 145 // }, 146 // output: ['output3', 'output4'], 147 // plugins: ['@hey-api/sdk'], 148 // }, 149 // ]; 150 151 // const results = await createClient(config); 152 // expect(results).toHaveLength(4); 153 // }); 154});