1+ // builtin tooling
2+ import path from "path"
3+
4+ // external tooling
15import test from "ava"
2- import compareFixtures from "./helpers/compare-fixtures"
36import postcss from "postcss"
7+
8+ // internal tooling
9+ import compareFixtures from "./helpers/compare-fixtures"
10+
11+ // plugin
412import atImport from ".."
5- import path from "path"
613
714test . serial ( "should accept file" , t => {
815 return compareFixtures ( t , "custom-resolve-file" , {
916 resolve : ( ) => {
10- return path . resolve ( "fixtures/imports/custom-resolve-1.css" )
17+ return path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" )
1118 } ,
1219 } )
1320} )
@@ -16,7 +23,7 @@ test.serial("should accept promised file", t => {
1623 return compareFixtures ( t , "custom-resolve-file" , {
1724 resolve : ( ) => {
1825 return Promise . resolve (
19- path . resolve ( "fixtures/imports/custom-resolve-1.css" )
26+ path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" )
2027 )
2128 } ,
2229 } )
@@ -26,9 +33,9 @@ test.serial("should accept array of files", t => {
2633 return compareFixtures ( t , "custom-resolve-array" , {
2734 resolve : ( ) => {
2835 return [
29- path . resolve ( "fixtures/imports/custom-resolve-1.css" ) ,
30- path . resolve ( "fixtures/imports/custom-resolve-2.css" ) ,
31- path . resolve ( "fixtures/imports/custom-resolve-1.css" ) ,
36+ path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" ) ,
37+ path . resolve ( "test/ fixtures/imports/custom-resolve-2.css" ) ,
38+ path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" ) ,
3239 ]
3340 } ,
3441 } )
@@ -38,9 +45,9 @@ test.serial("should accept promised array of files", t => {
3845 return compareFixtures ( t , "custom-resolve-array" , {
3946 resolve : ( ) => {
4047 return Promise . resolve ( [
41- path . resolve ( "fixtures/imports/custom-resolve-1.css" ) ,
42- path . resolve ( "fixtures/imports/custom-resolve-2.css" ) ,
43- path . resolve ( "fixtures/imports/custom-resolve-1.css" ) ,
48+ path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" ) ,
49+ path . resolve ( "test/ fixtures/imports/custom-resolve-2.css" ) ,
50+ path . resolve ( "test/ fixtures/imports/custom-resolve-1.css" ) ,
4451 ] )
4552 } ,
4653 } )
@@ -55,11 +62,11 @@ test(
5562 return path . replace ( "foo" , "imports/bar" )
5663 } ,
5764 load : p => {
58- t . is ( p , path . resolve ( "fixtures/imports" , "bar.css" ) )
65+ t . is ( p , path . resolve ( "test/ fixtures/imports" , "bar.css" ) )
5966 return "/* comment */"
6067 } ,
6168 } ) )
62- . process ( `@import "foo.css";` , { from : "fixtures/custom-resolve-file" } )
69+ . process ( `@import "foo.css";` , { from : "test/ fixtures/custom-resolve-file" } )
6370 . then ( result => {
6471 t . is ( result . css , "/* comment */" )
6572 } )
0 commit comments