Skip to content

Commit

Permalink
refactor tests with fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantiago committed Aug 28, 2020
1 parent 3a437bf commit 10c3d61
Show file tree
Hide file tree
Showing 18 changed files with 12,967 additions and 13,084 deletions.
94 changes: 0 additions & 94 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.24.1",
"coveralls": "^2.11.15",
"fs-promise": "^1.0.0",
"glob-contents": "0.0.3",
"jest": "^26.4.2",
"pify": "^3.0.0",
"prettier": "^2.1.1",
"webpack": "^3.11.0"
},
Expand Down
22 changes: 22 additions & 0 deletions test-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import fs from 'fs'
import path from 'path'

export const fixtures = [
'La.La.Land.2016.1080p.BluRay.x264-SPARKS.EN',
'Man.Of.Steel.2013.720p.BluRay.x264.YIFI',
'Wonder Woman 2017 (BluRay 1080p x265 10bit 7.1)_track3_eng'
]

export const getFixture = (filename, extension) => {
const filepath = path.join(
__dirname,
`/test/fixtures/${filename}.${extension}`
)

return new Promise((resolve, reject) =>
fs.readFile(filepath, 'utf8', (err, contents) => {
if (err) reject(err)
resolve(contents)
})
)
}
Loading

0 comments on commit 10c3d61

Please sign in to comment.