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