Data For Testing Multipart/Form-Data Algorithms.
npm install @multipart/test-form-data
@multipart/test-form-data is Data For Testing Multipart/Form-Data Algorithms Written As Zoroaster Mask.
``sh`
yarn add -D @multipart/test-form-data
- Table Of Contents
- API
- updateStore(store: Object)
- Copyright
The package is available by importing its named function, and by referencing the mask result file:
`js
import makeTestSuite from '@zoroaster/mask'
import { updateStore } from '@multipart/test-form-data'
export default makeTestSuite('node_modules/@multipart/test-form-data', {
getResults() {
// ... must return the store for comparison
}
})
`
`markdownbasic keys
[
{
"key": "name",
"value": "Bender"
},
{
"key": "hind",
"value": "Bitable"
},
{
"key": "shiny",
"value": "Yes"
}
]
/ expected /
{
"name": "Bender",
"hind": "Bitable",
"shiny": "Yes"
}
/**/
/ expected /
{
"bottle-on-wall": [
"1",
"2",
"3"
]
}
/**/
/ expected /
{
"pet": {
"species": "Dahut",
"name": "Hypatia"
},
"kids": [
"Ashley",
"Thelma"
]
}
/**/
/ expected /
{
"heartbeat": [
"thunk",
null,
"thunk"
]
}
/**/
/ expected /
{
"pet": [
{
"species": "Dahut",
"name": "Hypatia"
},
{
"species": "Felis Stultus",
"name": "Billie"
}
]
}
/**/
/ expected /
{
"wow": {
"such": {
"deep": [
null,
null,
null,
{
"much": {
"power": {
"!": "Amaze"
}
}
}
]
}
}
}
/**/
/ expected /
{
"mix": {
"0": "array 1",
"2": "array 2",
"": "scalar",
"key": "key key",
"car": "car key"
}
}
/**/
/ expected /
{
"error": {
"good": "BOOM!"
},
"error[bad": "BOOM BOOM!"
}
/**/
`
store: Object,
): voidUpdates the store to make undefined in sparse arrays appear as nulls for deepStrictEqual comparison.
`js
import { updateStore } from '@multipart/test-form-data'
const hello = []
hello[2] = 'test'
const store = { hello }
updateStore(store)
console.log(store)
````
{ hello: [ null, null, 'test' ] }
Original data by Linus Unnebäck.
---
![]() | © Art Deco for Idio 2019 | alt="Tech Nation Visa"> | Tech Nation Visa Sucks |
|---|