11import test from "ava" ;
2+ import conventionalChangelogAngular from "conventional-changelog-angular" ;
23import loadChangelogConfig from "../lib/load-changelog-config.js" ;
34
45const cwd = process . cwd ( ) ;
@@ -42,7 +43,7 @@ loadConfig.title = (providedTitle, config) => `${providedTitle} Load "${config}"
4243
4344test ( 'Load "conventional-changelog-angular" by default' , async ( t ) => {
4445 const changelogConfig = await loadChangelogConfig ( { } , { cwd } ) ;
45- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
46+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
4647
4748 t . deepEqual ( changelogConfig . parserOpts , angularChangelogConfig . parserOpts ) ;
4849 t . deepEqual ( changelogConfig . writerOpts , angularChangelogConfig . writerOpts ) ;
@@ -54,7 +55,7 @@ test('Accept a "parserOpts" object as option', async (t) => {
5455 headerCorrespondence : [ "tag" , "shortDesc" ] ,
5556 } ;
5657 const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOptions } , { cwd } ) ;
57- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
58+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
5859
5960 t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
6061 t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
@@ -65,7 +66,7 @@ test('Accept a "parserOpts" object as option', async (t) => {
6566test ( 'Accept a "writerOpts" object as option' , async ( t ) => {
6667 const customWriterOptions = { commitGroupsSort : "title" , commitsSort : [ "scope" , "subject" ] } ;
6768 const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOptions } , { cwd } ) ;
68- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
69+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
6970
7071 t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
7172 t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
@@ -79,7 +80,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a preset', a
7980 headerCorrespondence : [ "tag" , "shortDesc" ] ,
8081 } ;
8182 const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOptions , preset : "angular" } , { cwd } ) ;
82- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
83+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
8384
8485 t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
8586 t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
@@ -90,7 +91,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a preset', a
9091test ( 'Accept a "writerOpts" object as option that overwrite a preset' , async ( t ) => {
9192 const customWriterOptions = { commitGroupsSort : "title" , commitsSort : [ "scope" , "subject" ] } ;
9293 const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOptions , preset : "angular" } , { cwd } ) ;
93- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
94+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
9495
9596 t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
9697 t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
@@ -110,7 +111,7 @@ test('Accept a partial "parserOpts" object as option that overwrite a config', a
110111 } ,
111112 { cwd }
112113 ) ;
113- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
114+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
114115
115116 t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
116117 t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
@@ -127,7 +128,7 @@ test('Accept a "writerOpts" object as option that overwrite a config', async (t)
127128 } ,
128129 { cwd }
129130 ) ;
130- const angularChangelogConfig = await ( await import ( "conventional-changelog-angular" ) ) . default ;
131+ const angularChangelogConfig = await conventionalChangelogAngular ( ) ;
131132
132133 t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
133134 t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
0 commit comments