@@ -4,8 +4,7 @@ import { when } from 'jest-when';
4
4
import * as autoChangelog from '@metamask/auto-changelog' ;
5
5
import { SemVer } from 'semver' ;
6
6
import { MockWritable } from 'stdio-mock' ;
7
- import _outdent from 'outdent' ;
8
- import { withSandbox } from '../tests/helpers' ;
7
+ import { buildChangelog , withSandbox } from '../tests/helpers' ;
9
8
import {
10
9
buildMockPackage ,
11
10
buildMockProject ,
@@ -22,8 +21,6 @@ import * as fsModule from './fs';
22
21
import * as packageManifestModule from './package-manifest' ;
23
22
import * as repoModule from './repo' ;
24
23
25
- const outdent = _outdent ( { trimTrailingNewline : false } ) ;
26
-
27
24
jest . mock ( './package-manifest' ) ;
28
25
jest . mock ( './repo' ) ;
29
26
@@ -471,20 +468,18 @@ describe('package', () => {
471
468
472
469
await fs . promises . writeFile (
473
470
changelogPath ,
474
- outdent `
475
- # Changelog
476
- All notable changes to this project will be documented in this file.
477
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
478
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
479
- ## [Unreleased]
480
- ### Uncategorized
481
- - Add \`isNewFunction\` ([#2](https://repo.url/compare/package/pull/2))
482
- ## [1.0.0] - 2020-01-01
483
- ### Changed
484
- - Something else
485
- [Unreleased]: https://repo.url/compare/[email protected]
486
- [1.0.0]: https://repo.url/releases/tag/[email protected]
487
- ` ,
471
+ buildChangelog ( `
472
+ ## [Unreleased]
473
+ ### Uncategorized
474
+ - Add isNewFunction ([#2](https://repo.url/compare/package/pull/2))
475
+
476
+ ## [1.0.0] - 2020-01-01
477
+ ### Changed
478
+ - Something else
479
+
480
+ [Unreleased]: https://repo.url/compare/[email protected]
481
+ [1.0.0]: https://repo.url/releases/tag/[email protected]
482
+ ` ) ,
488
483
) ;
489
484
490
485
await updatePackage ( { project, packageReleasePlan } ) ;
@@ -494,27 +489,23 @@ describe('package', () => {
494
489
'utf8' ,
495
490
) ;
496
491
497
- expect ( newChangelogContent ) . toBe ( outdent `
498
- # Changelog
499
- All notable changes to this project will be documented in this file.
500
-
501
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
502
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
492
+ expect ( newChangelogContent ) . toBe (
493
+ buildChangelog ( `
494
+ ## [Unreleased]
503
495
504
- ## [Unreleased]
496
+ ## [2.0.0]
497
+ ### Uncategorized
498
+ - Add isNewFunction ([#2](https://repo.url/compare/package/pull/2))
505
499
506
- ## [2 .0.0]
507
- ### Uncategorized
508
- - Add \`isNewFunction\` ([#2](https://repo.url/compare/package/pull/2))
500
+ ## [1 .0.0] - 2020-01-01
501
+ ### Changed
502
+ - Something else
509
503
510
- ## [1.0.0] - 2020-01-01
511
- ### Changed
512
- - Something else
513
-
514
- [Unreleased]: https://repo.url/compare/[email protected]
515
- [2.0.0]: https://repo.url/compare/[email protected] @2.0.0
516
- [1.0.0]: https://repo.url/releases/tag/[email protected]
517
- ` ) ;
504
+ [Unreleased]: https://repo.url/compare/[email protected]
505
+ [2.0.0]: https://repo.url/compare/[email protected] @2.0.0
506
+ [1.0.0]: https://repo.url/releases/tag/[email protected]
507
+ ` ) ,
508
+ ) ;
518
509
} ) ;
519
510
} ) ;
520
511
0 commit comments