Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MIME Normalizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
JS Toolbox
MIME Normalizer
Commits
efc1a746
Commit
efc1a746
authored
4 years ago
by
Igor Markin
Browse files
Options
Downloads
Patches
Plain Diff
Upgrades lib-mime, uses JSDOM instead of @vereign/dom
parent
9a587685
No related branches found
No related tags found
1 merge request
!25
Resolve "Upgrade light-utils and lib-mime"
Pipeline
#42697
failed
4 years ago
Stage: install
Stage: test
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
__tests__/helpers/index.ts
+14
-8
14 additions, 8 deletions
__tests__/helpers/index.ts
package.json
+3
-3
3 additions, 3 deletions
package.json
yarn.lock
+158
-125
158 additions, 125 deletions
yarn.lock
with
175 additions
and
136 deletions
__tests__/helpers/index.ts
+
14
−
8
View file @
efc1a746
import
{
JSDOM
}
from
"
jsdom
"
;
import
{
JSDOM
}
from
"
jsdom
"
;
const
crypto
=
require
(
"
crypto
"
);
const
crypto
=
require
(
"
crypto
"
);
import
MIMEParser
from
"
@vereign/mime
-parser
"
;
import
MIMEParser
from
"
@vereign/
lib-
mime
"
;
import
{
expect
,
test
}
from
"
@jest/globals
"
;
import
{
expect
,
test
}
from
"
@jest/globals
"
;
import
{
DOM
}
from
"
@vereign/dom
"
;
import
{
PlainNormalizer
,
HTMLNormalizer
}
from
"
../../src
"
;
import
{
PlainNormalizer
,
HTMLNormalizer
}
from
"
../../src
"
;
import
{
listDirectories
,
readFile
}
from
"
./fileReader
"
;
import
{
listDirectories
,
readFile
}
from
"
./fileReader
"
;
...
@@ -207,11 +206,21 @@ const prepareTestCases = (
...
@@ -207,11 +206,21 @@ const prepareTestCases = (
`
${
testsCasesPath
}
/
${
caseDir
}
/
${
RECEIVED_EML_NAME
}
`
`
${
testsCasesPath
}
/
${
caseDir
}
/
${
RECEIVED_EML_NAME
}
`
);
);
const
sentParsedMime
=
new
MIMEParser
(
sentMimeString
);
sentParsedMime
.
parseHTML
=
(
htmlString
:
string
)
=>
{
return
new
JSDOM
(
htmlString
).
window
.
document
;
};
const
receivedParsedMime
=
new
MIMEParser
(
receivedMimeString
);
receivedParsedMime
.
parseHTML
=
(
htmlString
:
string
)
=>
{
return
new
JSDOM
(
htmlString
).
window
.
document
;
};
return
[
return
[
caseDir
,
caseDir
,
{
{
sentMime
:
new
MIMEParser
(
sentMimeString
)
,
sentMime
:
sentParsedMime
,
receivedMime
:
new
MIMEParser
(
receivedMimeString
)
,
receivedMime
:
receivedParsedMime
,
},
},
];
];
});
});
...
@@ -249,10 +258,7 @@ export const getDOMDocuments = async (
...
@@ -249,10 +258,7 @@ export const getDOMDocuments = async (
sentHtmlDocument
:
HTMLDocument
;
sentHtmlDocument
:
HTMLDocument
;
receivedHtmlDocument
:
HTMLDocument
;
receivedHtmlDocument
:
HTMLDocument
;
}
>
=>
{
}
>
=>
{
/**
const
sentDOM
=
new
JSDOM
(
* Usage of the @vereign/dom is a must, because of Google Add-on.
*/
const
sentDOM
=
new
DOM
(
await
sentMime
.
getHTML
({
await
sentMime
.
getHTML
({
populateAttachments
:
POPULATE_ATTACHMENTS
,
populateAttachments
:
POPULATE_ATTACHMENTS
,
hashAttachment
,
hashAttachment
,
...
...
This diff is collapsed.
Click to expand it.
package.json
+
3
−
3
View file @
efc1a746
...
@@ -12,15 +12,15 @@
...
@@ -12,15 +12,15 @@
"
@babel/preset-typescript
"
:
"
^7.10.4
"
,
"
@babel/preset-typescript
"
:
"
^7.10.4
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^3.10.1
"
,
"
@typescript-eslint/eslint-plugin
"
:
"
^3.10.1
"
,
"
@typescript-eslint/parser
"
:
"
^3.10.1
"
,
"
@typescript-eslint/parser
"
:
"
^3.10.1
"
,
"
@vereign/dom
"
:
"
git+ssh://git@code.vereign.com:code/js-toolbox/gsdom.git
"
,
"
@vereign/lib-mime
"
:
"
^1.1.2
"
,
"
@vereign/mime-parser
"
:
"
git+ssh://git@code.vereign.com:code/js-toolbox/mime-parser.git
"
,
"
@vereign/light-utils
"
:
"
git+ssh://git@code.vereign.com:seal/building-blocks/signing-verification-utilities.git
"
,
"
@vereign/light-utils
"
:
"
git+ssh://git@code.vereign.com:seal/building-blocks/signing-verification-utilities.git#implement-iframe-api
"
,
"
babel-eslint
"
:
"
^10.1.0
"
,
"
babel-eslint
"
:
"
^10.1.0
"
,
"
babel-jest
"
:
"
^26.3.0
"
,
"
babel-jest
"
:
"
^26.3.0
"
,
"
eslint
"
:
"
^7.7.0
"
,
"
eslint
"
:
"
^7.7.0
"
,
"
husky
"
:
"
^4.2.5
"
,
"
husky
"
:
"
^4.2.5
"
,
"
jest
"
:
"
^26.4.2
"
,
"
jest
"
:
"
^26.4.2
"
,
"
jest-diff
"
:
"
^26.6.2
"
,
"
jest-diff
"
:
"
^26.6.2
"
,
"
jsdom
"
:
"
^16.6.0
"
,
"
lint-staged
"
:
"
^10.2.13
"
,
"
lint-staged
"
:
"
^10.2.13
"
,
"
prettier
"
:
"
^2.1.1
"
,
"
prettier
"
:
"
^2.1.1
"
,
"
typescript
"
:
"
^4.0.2
"
"
typescript
"
:
"
^4.0.2
"
...
...
This diff is collapsed.
Click to expand it.
yarn.lock
+
158
−
125
View file @
efc1a746
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment