_test_setup_start.js 580 B

12345678910111213141516171819202122
  1. 'use strict'
  2. const fs = require('fs-extra')
  3. const path = require('path')
  4. const setup = async () => {
  5. console.log('Running pre-tests script...')
  6. const testDir = path.resolve(__dirname, '..')
  7. const imagesTestDir = path.resolve(testDir, 'images_test')
  8. const imagesDir = path.resolve(testDir, 'images')
  9. console.log('Removing /test/images directory...')
  10. await fs.remove(imagesDir)
  11. console.log('Copying /test/images_test directory to /test/images...')
  12. await fs.copy(imagesTestDir, imagesDir)
  13. console.log('Pre-tests script finished. Running tests...')
  14. }
  15. setup()