Download spectrum/shared/testing/empty-db.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/testing/empty-db.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/testing/empty-db.js
-
curl -L -o empty-db.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/testing/empty-db.js
396 Bytes
| import data from './data'; | |
| import db from './db'; | |
| const tables = Object.keys(data); | |
| /** | |
| * This is run after all tests | |
| */ | |
| export const empty = db => { | |
| // Create the tables | |
| return Promise.all( | |
| tables.map(table => | |
| db | |
| .table(table) | |
| .delete() | |
| .run() | |
| ) | |
| ).catch(err => { | |
| console.log(err); | |
| throw err; | |
| }); | |
| }; | |
| empty(db).then(() => process.exit()); | |