[Pkg-javascript-commits] [pdf.js] 338/414: Use `beforeAll`/`afterAll` in `isExternalLinkTargetSet` in dom_utils_spec.js (issue 6905)
David Prévot
taffit at moszumanska.debian.org
Tue Jun 28 17:12:37 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit c6c5b8fab812b8b783d44eabc5f8d03d05f45156
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date: Thu Apr 7 14:00:40 2016 +0200
Use `beforeAll`/`afterAll` in `isExternalLinkTargetSet` in dom_utils_spec.js (issue 6905)
Re: issue 6905.
---
test/unit/dom_utils_spec.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/test/unit/dom_utils_spec.js b/test/unit/dom_utils_spec.js
index ae20a70..025fc38 100644
--- a/test/unit/dom_utils_spec.js
+++ b/test/unit/dom_utils_spec.js
@@ -1,5 +1,5 @@
/* globals expect, it, describe, PDFJS, isExternalLinkTargetSet, LinkTarget,
- getFilenameFromUrl */
+ getFilenameFromUrl, beforeAll, afterAll */
'use strict';
@@ -21,8 +21,16 @@ describe('dom_utils', function() {
});
describe('isExternalLinkTargetSet', function() {
- // Save the current state, to avoid interfering with other tests.
- var previousExternalLinkTarget = PDFJS.externalLinkTarget;
+ var savedExternalLinkTarget;
+
+ beforeAll(function (done) {
+ savedExternalLinkTarget = PDFJS.externalLinkTarget;
+ done();
+ });
+
+ afterAll(function () {
+ PDFJS.externalLinkTarget = savedExternalLinkTarget;
+ });
it('handles the predefined LinkTargets', function() {
for (var key in LinkTarget) {
@@ -43,8 +51,5 @@ describe('dom_utils', function() {
expect(isExternalLinkTargetSet()).toEqual(false);
}
});
-
- // Reset the state.
- PDFJS.externalLinkTarget = previousExternalLinkTarget;
});
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list