Skip to content

Commit 9d04a9a

Browse files
committed
Add test cases for import rewriting
1 parent 172991b commit 9d04a9a

4 files changed

Lines changed: 92 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
app: {
3+
utils: {
4+
'nested.js': '"nested util"',
5+
'single.js': '"single util"'
6+
},
7+
routes: {
8+
'application.js': 'import NestedUtil from "my-app/utils/nested"; import SingleUtil from "my-app/utils/single";'
9+
}
10+
},
11+
tests: {
12+
unit: {
13+
utils: {
14+
'nested-test.js': '"nested util test"'
15+
},
16+
routes: {
17+
'application-test.js': 'import ApplicationRoute from "my-app/routes/application";'
18+
}
19+
}
20+
}
21+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
src: {
3+
ui: {
4+
routes: {
5+
application: {
6+
'route.js': 'import NestedUtil from "my-app/src/utils/nested/util"; import SingleUtil from "my-app/src/utils/single";',
7+
'route-unit-test.js': 'import ApplicationRoute from "my-app/src/ui/routes/application/route";'
8+
}
9+
}
10+
},
11+
utils: {
12+
nested: {
13+
'util.js': '"nested util"',
14+
'util-unit-test.js': '"nested util test"'
15+
},
16+
'single.js': '"single util"'
17+
}
18+
}
19+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
app: {
3+
utils: {
4+
'nested.js': '"nested util"',
5+
'single.js': '"single util"',
6+
'derived-nested.js': 'import NestedUtil from "./nested";',
7+
'derived-single.js': 'import SingleUtil from "./single";'
8+
},
9+
routes: {
10+
'application.js': 'import NestedUtil from "../utils/nested"; import SingleUtil from "../utils/single";',
11+
'index.js': 'import ApplicationRoute from "./application";',
12+
post: {
13+
'index.js': 'import ApplicationRoute from "../application";'
14+
}
15+
}
16+
},
17+
tests: {
18+
unit: {
19+
utils: {
20+
'nested-test.js': '"nested util test"'
21+
},
22+
routes: {
23+
'application-test.js': 'import ApplicationRoute from "../../../app/routes/application";'
24+
}
25+
}
26+
}
27+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
src: {
3+
ui: {
4+
routes: {
5+
application: {
6+
'route.js': 'import NestedUtil from "../../../utils/nested/util"; import SingleUtil from "../../../utils/single";',
7+
'route-unit-test.js': 'import ApplicationRoute from "./route";'
8+
},
9+
'index.js': 'import ApplicationRoute from "./application/route";',
10+
post: {
11+
'index.js': 'import ApplicationRoute from "../application/route";'
12+
}
13+
}
14+
},
15+
utils: {
16+
'derived-nested.js': 'import NestedUtil from "./nested/util";',
17+
'derived-single.js': 'import SingleUtil from "./single";',
18+
nested: {
19+
'util.js': '"nested util"',
20+
'util-unit-test.js': '"nested util test"'
21+
},
22+
'single.js': '"single util"'
23+
}
24+
}
25+
};

0 commit comments

Comments
 (0)