forked from microsoft/rushstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeFile.test.ts
More file actions
37 lines (30 loc) · 1.18 KB
/
ChangeFile.test.ts
File metadata and controls
37 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import * as path from 'path';
import { ChangeFile } from '../ChangeFile';
import { RushConfiguration } from '../RushConfiguration';
import { ChangeType } from '../ChangeManagement';
describe('ChangeFile', () => {
it('can add a change', () => {
const rushFilename: string = path.resolve(__dirname, 'repo', 'rush-npm.json');
const rushConfiguration: RushConfiguration = RushConfiguration.loadFromConfigurationFile(rushFilename);
const changeFile: ChangeFile = new ChangeFile({
packageName: 'a',
changes: [],
email: 'fake@microsoft.com'
}, rushConfiguration);
changeFile.addChange({
packageName: 'a',
changeType: ChangeType.minor,
comment: 'for minor'
});
changeFile.addChange({
packageName: 'a',
changeType: ChangeType.patch,
comment: 'for patch'
});
expect(changeFile.getChanges('a').length).toEqual(2);
expect(changeFile.getChanges('a')[0].comment).toEqual('for minor');
expect(changeFile.getChanges('a')[1].comment).toEqual('for patch');
});
});