Skip to content

Commit

Permalink
Merge branch 'master' into handle-node-modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tribou committed May 17, 2018
2 parents 26bf921 + 6ab7111 commit 68d49b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/__snapshots__/index_test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ Object {
exports[`serializer replaces process.cwd with <PROJECT_ROOT> 1`] = `"<PROJECT_ROOT>"`;
exports[`serializer replaces process.cwd with <PROJECT_ROOT> in Object key 1`] = `
Object {
"<PROJECT_ROOT>/nested/cwd": "is root",
"fake": "value",
}
`;
exports[`serializer replaces process.cwd with <PROJECT_ROOT> in Object properties 1`] = `
Object {
"myPath": "<PROJECT_ROOT>/src",
Expand Down
8 changes: 8 additions & 0 deletions lib/index_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ describe("serializer", () => {
expect(sut).toMatchSnapshot();
});

it("replaces process.cwd with <PROJECT_ROOT> in Object key", () => {
const sut = {
fake: "value",
[path.resolve(process.cwd(), "nested/cwd")]: "is root"
};
expect(sut).toMatchSnapshot();
});

it("replaces process.cwd with <PROJECT_ROOT> in array", () => {
const sut = [path.resolve(process.cwd(), "src")];
expect(sut).toMatchSnapshot();
Expand Down

0 comments on commit 68d49b6

Please sign in to comment.