Add .contentType and .charset options for importFromFile()
And use them in new importTextAttachment() and importHTMLAttachment() test support functions. These can be used to avoid needing a hidden browser for determining the character set of the imported text documents.
This commit is contained in:
parent
b1fad5a310
commit
9a3ff2d244
3 changed files with 41 additions and 21 deletions
|
@ -851,6 +851,16 @@ function importFileAttachment(filename, options = {}) {
|
|||
}
|
||||
|
||||
|
||||
function importTextAttachment() {
|
||||
return importFileAttachment('test.txt', { contentType: 'text/plain', charset: 'utf-8' });
|
||||
}
|
||||
|
||||
|
||||
function importHTMLAttachment() {
|
||||
return importFileAttachment('test.html', { contentType: 'text/html', charset: 'utf-8' });
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the fake XHR server to response to a given response
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue