Skip to content

Commit

Permalink
fix: fix prepare test script os compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed Sep 25, 2023
1 parent cd6f4ae commit 7b300db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "vite build",
"preview": "vite build && vite preview",
"lint": "eslint src",
"prepare-test": "./scripts/prepare-test.js",
"prepare-test": "node ./scripts/prepare-test.js",
"test": "playwright test -c tests/e2e"
},
"dependencies": {
Expand Down Expand Up @@ -69,6 +69,7 @@
"@vitejs/plugin-react-swc": "3.4.0",
"autoprefixer": "10.4.16",
"eslint": "8.50.0",
"mkdirp": "3.0.1",
"postcss": "8.4.30",
"sass": "1.68.0",
"tailwindcss": "3.3.3",
Expand Down
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

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

9 changes: 4 additions & 5 deletions scripts/prepare-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env zx
import { invert } from 'lodash-es'
import path from 'path-browserify'
import { $, cd, fs } from 'zx'
import { mkdirp } from 'mkdirp'
import { $, cd, fs, path } from 'zx'

const testRomsBaseUrl = 'https://buildbot.libretro.com/assets/cores/'

Expand Down Expand Up @@ -42,10 +41,10 @@ const wd = process.cwd()
async function downloadTestRoms() {
for (const systemFullName in testRomsGroups) {
const system = systemFullNameMap[systemFullName]
const systemRomsDirectory = path.join(wd, 'tests/fixtures/roms', system)
const systemRomsDirectory = path.join(wd, 'tests', 'fixtures', 'roms', system)

if (!(await fs.exists(systemRomsDirectory))) {
await $`mkdir -p ${systemRomsDirectory}`
await mkdirp(systemRomsDirectory)
}

cd(systemRomsDirectory)
Expand Down

0 comments on commit 7b300db

Please sign in to comment.