|
| 1 | +/** |
| 2 | + * Copyright (c) "Neo4j" |
| 3 | + * Neo4j Sweden AB [http://neo4j.com] |
| 4 | + * |
| 5 | + * This file is part of Neo4j. |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import { ServerInfo } from '../src/result-summary' |
| 21 | + |
| 22 | +describe('ServerInfo', () => { |
| 23 | + it.each([ |
| 24 | + [ |
| 25 | + { address: '192.168.0.1', version: 'neo4j' }, |
| 26 | + 4.3, |
| 27 | + { |
| 28 | + address: '192.168.0.1', |
| 29 | + version: 'neo4j', |
| 30 | + protocolVersion: 4.3, |
| 31 | + agent: 'neo4j' |
| 32 | + } |
| 33 | + ], |
| 34 | + [ |
| 35 | + { address: '192.168.0.1', version: 'neo4j' }, |
| 36 | + undefined, |
| 37 | + { |
| 38 | + address: '192.168.0.1', |
| 39 | + version: 'neo4j', |
| 40 | + protocolVersion: undefined, |
| 41 | + agent: 'neo4j' |
| 42 | + } |
| 43 | + ], |
| 44 | + [undefined, 4.3, { protocolVersion: 4.3 }], |
| 45 | + [undefined, undefined, {}] |
| 46 | + ])( |
| 47 | + 'new ServerInfo(%o, %i) === %j', |
| 48 | + (meta, protocolVersion, expectedServerInfo) => { |
| 49 | + expect(new ServerInfo(meta, protocolVersion)).toEqual(expectedServerInfo) |
| 50 | + } |
| 51 | + ) |
| 52 | +}) |
0 commit comments