| // Copyright 2022 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| import chai from 'chai'; // not esm |
| import * as constant from '../src/constants'; |
| import { copyHeaderConst } from '../src/fields'; |
| |
| before(() => { |
| chai.should(); |
| }); |
| |
| describe('copyHeaderConst', () => { |
| it('makes a deep copy of the constant', () => { |
| let test = copyHeaderConst(); |
| test.should.deep.equal(constant.LOGS_HEADERS); |
| }); |
| |
| it('will not change values in original reference', () => { |
| let test = copyHeaderConst(); |
| test['message'].displayName = 'Not-Message'; |
| constant.LOGS_HEADERS['message'].displayName.should.deep.equal('Message'); |
| test['message'].displayName.should.deep.equal('Not-Message'); |
| test.should.not.deep.equal(constant.LOGS_HEADERS); |
| }); |
| }); |