|
1 | 1 | const test = require('ava'); |
2 | 2 |
|
3 | | -const Script = require('..'); |
| 3 | +const pickOriginal = require('..'); |
4 | 4 |
|
5 | | -test.beforeEach(t => { |
6 | | - const script = new Script({}); |
7 | | - Object.assign(t.context, { script }); |
8 | | -}); |
9 | | - |
10 | | -test('returns itself', t => { |
11 | | - t.true(t.context.script instanceof Script); |
12 | | -}); |
13 | | - |
14 | | -test('sets a config object', t => { |
15 | | - const script = new Script(false); |
16 | | - t.true(script instanceof Script); |
17 | | -}); |
18 | | - |
19 | | -test('renders name', t => { |
20 | | - const { script } = t.context; |
21 | | - t.is(script.renderName(), 'script'); |
22 | | -}); |
23 | | - |
24 | | -test('sets a default name', t => { |
25 | | - const { script } = t.context; |
26 | | - t.is(script._name, 'script'); |
| 5 | +test('picks original', t => { |
| 6 | + t.deepEqual( |
| 7 | + pickOriginal( |
| 8 | + { |
| 9 | + foo: { |
| 10 | + boop: { baz: false }, |
| 11 | + array: [0, 1, 2, 3, 4, 5, 6, 7, 8], |
| 12 | + arr: [ |
| 13 | + { |
| 14 | + baz: true, |
| 15 | + bar: false, |
| 16 | + beep: { |
| 17 | + foo: [ |
| 18 | + 1, |
| 19 | + { |
| 20 | + baz: 'foo' |
| 21 | + }, |
| 22 | + 3 |
| 23 | + ] |
| 24 | + } |
| 25 | + } |
| 26 | + ] |
| 27 | + } |
| 28 | + }, |
| 29 | + { |
| 30 | + foo: { |
| 31 | + array: [0, 1, 2, 3, 4], |
| 32 | + arr: [ |
| 33 | + { |
| 34 | + baz: true, |
| 35 | + beep: { |
| 36 | + foo: [ |
| 37 | + 1, |
| 38 | + { |
| 39 | + baz: 'foo' |
| 40 | + } |
| 41 | + ] |
| 42 | + } |
| 43 | + } |
| 44 | + ] |
| 45 | + } |
| 46 | + } |
| 47 | + ), |
| 48 | + { |
| 49 | + foo: { |
| 50 | + array: [0, 1, 2, 3, 4], |
| 51 | + arr: [ |
| 52 | + { |
| 53 | + baz: true, |
| 54 | + beep: { |
| 55 | + foo: [ |
| 56 | + 1, |
| 57 | + { |
| 58 | + baz: 'foo' |
| 59 | + } |
| 60 | + ] |
| 61 | + } |
| 62 | + } |
| 63 | + ] |
| 64 | + } |
| 65 | + } |
| 66 | + ); |
27 | 67 | }); |
0 commit comments