-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): use args[n][m] instead of getCall(n).args[m] (#630)
- Loading branch information
1 parent
9493abd
commit 5ae264f
Showing
14 changed files
with
106 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,9 @@ describe('Unit: Extensions > Nginx > Acme', function () { | |
expect(emptyStub.calledOnce).to.be.true; | ||
expect(gotStub.calledOnce).to.be.true; | ||
expect(downloadStub.calledOnce).to.be.true; | ||
expect(downloadStub.getCall(0).args[0]).to.equal(dwUrl); | ||
expect(sudoStub.getCall(0).args[0]).to.match(/mkdir -p/); | ||
expect(sudoStub.getCall(1).args[0]).to.match(/acme\.sh --install/); | ||
expect(downloadStub.args[0][0]).to.equal(dwUrl); | ||
expect(sudoStub.args[0][0]).to.match(/mkdir -p/); | ||
expect(sudoStub.args[1][0]).to.match(/acme\.sh --install/); | ||
}); | ||
}); | ||
|
||
|
@@ -175,12 +175,12 @@ describe('Unit: Extensions > Nginx > Acme', function () { | |
|
||
return acme.generate({sudo: sudoStub}, 'domain', 'root', '[email protected]').then(() => { | ||
expect(sudoStub.calledOnce).to.be.true; | ||
expect(sudoStub.getCall(0).args[0]).to.match(expectedSudo); | ||
expect(sudoStub.args[0][0]).to.match(expectedSudo); | ||
|
||
return acme.generate({sudo: sudoStub}, 'domain', 'root', '[email protected]', true); | ||
}).then(() => { | ||
expect(sudoStub.calledTwice).to.be.true; | ||
expect(sudoStub.getCall(1).args[0]).to.match(/--issue .{0,} --staging/); | ||
expect(sudoStub.args[1][0]).to.match(/--issue .{0,} --staging/); | ||
}); | ||
}); | ||
|
||
|
@@ -232,7 +232,7 @@ describe('Unit: Extensions > Nginx > Acme', function () { | |
|
||
return acme.remove('ghost.org', {sudo: sudoStub}).then(() => { | ||
expect(sudoStub.calledOnce).to.be.true; | ||
expect(sudoStub.getCall(0).args[0]).to.equal( | ||
expect(sudoStub.args[0][0]).to.equal( | ||
'/etc/letsencrypt/acme.sh --remove --home /etc/letsencrypt --domain ghost.org' | ||
) | ||
}); | ||
|
@@ -248,7 +248,7 @@ describe('Unit: Extensions > Nginx > Acme', function () { | |
|
||
return acme.remove('ghost.org', {sudo: sudoStub}, '/home/ghost/.acme.sh').then(() => { | ||
expect(sudoStub.calledOnce).to.be.true; | ||
expect(sudoStub.getCall(0).args[0]).to.equal( | ||
expect(sudoStub.args[0][0]).to.equal( | ||
'/home/ghost/.acme.sh/acme.sh --remove --home /home/ghost/.acme.sh --domain ghost.org' | ||
) | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.