Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8b56221

Browse files
pvdlggr2m
authored andcommitted
test: fix integration test to always use a temp directory
1 parenta39db0e commit8b56221

File tree

1 file changed

+43
-37
lines changed

1 file changed

+43
-37
lines changed

‎test/integration.test.js‎

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ test.serial('Return nothing for an unpublished package', async t => {
224224
t.falsy(nextRelease);
225225
});
226226

227-
test('Throw SemanticReleaseError if publish "pkgRoot" option in getLastRelease is not a String',asynct=>{
228-
constpkg={name:'invalid-pkgRoot',publishConfig:{registry:npmRegistry.url}};
229-
awaitoutputJson('./dist/package.json',pkg);
227+
test.serial('Throw SemanticReleaseError if publish "pkgRoot" option in getLastRelease is not a String',asynct=>{
228+
constpkg={name:'invalid-pkgRoot',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
229+
awaitoutputJson('./package.json',pkg);
230230
constpkgRoot=42;
231231
consterror=awaitt.throws(
232232
t.context.m.getLastRelease(
@@ -242,45 +242,51 @@ test('Throw SemanticReleaseError if publish "pkgRoot" option in getLastRelease i
242242
t.is(error.code,'EINVALIDPKGROOT');
243243
});
244244

245-
test('Throw SemanticReleaseError if publish "npmPublish" option in verifyConditions is not a Boolean',asynct=>{
246-
constpkg={name:'invalid-npmPublish',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
247-
awaitoutputJson('./package.json',pkg);
248-
constnpmPublish=42;
249-
consterror=awaitt.throws(
250-
t.context.m.verifyConditions(
251-
{},
252-
{
253-
options:{publish:['@semantic-release/github',{path:'@semantic-release/npm', npmPublish}]},
254-
logger:t.context.logger,
255-
}
256-
)
257-
);
245+
test.serial(
246+
'Throw SemanticReleaseError if publish "npmPublish" option in verifyConditions is not a Boolean',
247+
asynct=>{
248+
constpkg={name:'invalid-npmPublish',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
249+
awaitoutputJson('./package.json',pkg);
250+
constnpmPublish=42;
251+
consterror=awaitt.throws(
252+
t.context.m.verifyConditions(
253+
{},
254+
{
255+
options:{publish:['@semantic-release/github',{path:'@semantic-release/npm', npmPublish}]},
256+
logger:t.context.logger,
257+
}
258+
)
259+
);
258260

259-
t.is(error.name,'SemanticReleaseError');
260-
t.is(error.code,'EINVALIDNPMPUBLISH');
261-
});
261+
t.is(error.name,'SemanticReleaseError');
262+
t.is(error.code,'EINVALIDNPMPUBLISH');
263+
}
264+
);
262265

263-
test('Throw SemanticReleaseError if publish "tarballDir" option in verifyConditions is not a String',asynct=>{
264-
constpkg={name:'invalid-tarballDir',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
265-
awaitoutputJson('./package.json',pkg);
266-
consttarballDir=42;
267-
consterror=awaitt.throws(
268-
t.context.m.verifyConditions(
269-
{},
270-
{
271-
options:{publish:['@semantic-release/github',{path:'@semantic-release/npm', tarballDir}]},
272-
logger:t.context.logger,
273-
}
274-
)
275-
);
266+
test.serial(
267+
'Throw SemanticReleaseError if publish "tarballDir" option in verifyConditions is not a String',
268+
asynct=>{
269+
constpkg={name:'invalid-tarballDir',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
270+
awaitoutputJson('./package.json',pkg);
271+
consttarballDir=42;
272+
consterror=awaitt.throws(
273+
t.context.m.verifyConditions(
274+
{},
275+
{
276+
options:{publish:['@semantic-release/github',{path:'@semantic-release/npm', tarballDir}]},
277+
logger:t.context.logger,
278+
}
279+
)
280+
);
276281

277-
t.is(error.name,'SemanticReleaseError');
278-
t.is(error.code,'EINVALIDTARBALLDIR');
279-
});
282+
t.is(error.name,'SemanticReleaseError');
283+
t.is(error.code,'EINVALIDTARBALLDIR');
284+
}
285+
);
280286

281-
test('Throw SemanticReleaseError if publish "pkgRoot" option in verifyConditions is not a String',asynct=>{
287+
test.serial('Throw SemanticReleaseError if publish "pkgRoot" option in verifyConditions is not a String',asynct=>{
282288
constpkg={name:'invalid-pkgRoot',version:'0.0.0-dev',publishConfig:{registry:npmRegistry.url}};
283-
awaitoutputJson('./dist/package.json',pkg);
289+
awaitoutputJson('./package.json',pkg);
284290
constpkgRoot=42;
285291
consterror=awaitt.throws(
286292
t.context.m.verifyConditions(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp