1- import path from 'path' ;
2- import test from 'ava' ;
3- import { copy , ensureDir } from 'fs-extra' ;
4- import { isPlainObject , sortBy } from 'lodash' ;
5- import tempy from 'tempy' ;
6- import globAssets from '../lib/glob-assets' ;
1+ const path = require ( 'path' ) ;
2+ const test = require ( 'ava' ) ;
3+ const { copy, ensureDir} = require ( 'fs-extra' ) ;
4+ const { isPlainObject, sortBy} = require ( 'lodash' ) ;
5+ const tempy = require ( 'tempy' ) ;
6+ const globAssets = require ( '../lib/glob-assets' ) ;
77
88const sortAssets = assets => sortBy ( assets , asset => ( isPlainObject ( asset ) ? asset . path : asset ) ) ;
99
1010const fixtures = 'test/fixtures/files' ;
1111
12- test ( 'Retrieve file from single path' , async t => {
12+ test ( 'Retrieve file = require( single path' , async t => {
1313 const cwd = tempy . directory ( ) ;
1414 await copy ( fixtures , cwd ) ;
1515 const globbedAssets = await globAssets ( { cwd} , [ 'upload.txt' ] ) ;
1616
1717 t . deepEqual ( globbedAssets , [ 'upload.txt' ] ) ;
1818} ) ;
1919
20- test ( 'Retrieve multiple files from path' , async t => {
20+ test ( 'Retrieve multiple files = require( path' , async t => {
2121 const cwd = tempy . directory ( ) ;
2222 await copy ( fixtures , cwd ) ;
2323 const globbedAssets = await globAssets ( { cwd} , [ 'upload.txt' , 'upload_other.txt' ] ) ;
@@ -33,7 +33,7 @@ test('Include missing files as defined, using Object definition', async t => {
3333 t . deepEqual ( sortAssets ( globbedAssets ) , sortAssets ( [ 'upload.txt' , { path : 'miss*.txt' , label : 'Missing' } ] ) ) ;
3434} ) ;
3535
36- test ( 'Retrieve multiple files from Object' , async t => {
36+ test ( 'Retrieve multiple files = require( Object' , async t => {
3737 const cwd = tempy . directory ( ) ;
3838 await copy ( fixtures , cwd ) ;
3939 const globbedAssets = await globAssets ( { cwd} , [
@@ -84,15 +84,15 @@ test('Favor Object over String values when removing duplicates', async t => {
8484 ) ;
8585} ) ;
8686
87- test ( 'Retrieve file from single glob' , async t => {
87+ test ( 'Retrieve file = require( single glob' , async t => {
8888 const cwd = tempy . directory ( ) ;
8989 await copy ( fixtures , cwd ) ;
9090 const globbedAssets = await globAssets ( { cwd} , [ 'upload.*' ] ) ;
9191
9292 t . deepEqual ( globbedAssets , [ 'upload.txt' ] ) ;
9393} ) ;
9494
95- test ( 'Retrieve multiple files from single glob' , async t => {
95+ test ( 'Retrieve multiple files = require( single glob' , async t => {
9696 const cwd = tempy . directory ( ) ;
9797 await copy ( fixtures , cwd ) ;
9898 const globbedAssets = await globAssets ( { cwd} , [ '*.txt' ] ) ;
0 commit comments