-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sorting differences with npm deps (#68)
- Loading branch information
Showing
3 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`It orders dependencies in alphabetical order 1`] = ` | ||
"{ | ||
\\"dependencies\\": { | ||
\\"a\\": \\"1\\", | ||
\\"foo-bar\\": \\"2\\", | ||
\\"foo_bar\\": \\"3\\", | ||
\\"g\\": \\"4\\" | ||
} | ||
} | ||
" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { format } from '../src'; | ||
|
||
test('It orders dependencies in alphabetical order', () => { | ||
const json = { | ||
dependencies: { | ||
foo_bar: "3", | ||
g: "4", | ||
a: "1", | ||
"foo-bar": "2", // the "-" should be before the "_" to match `npm` sorting | ||
} | ||
}; | ||
|
||
expect(format(json)).toMatchSnapshot(); | ||
}); |