Skip to content

Commit

Permalink
chore: update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
tricoder42 authored and Photonios committed Dec 9, 2019
1 parent 26ff3b7 commit e15e81d
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 163 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"chalk": "^2.3.0",
"cli-table": "^0.3.1",
"commander": "^2.17.1",
"fuzzaldrin": "^2.1.0",
"date-fns": "^1.29.0",
"fuzzaldrin": "^2.1.0",
"glob": "^7.1.2",
"inquirer": "^6.2.0",
"make-plural": "^4.1.1",
Expand Down
15 changes: 12 additions & 3 deletions packages/cli/src/api/extract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe("extract", function() {
})

describe("collect", function() {
beforeAll(() => {
beforeEach(() => {
mockFs({
src: {
components: {
Expand Down Expand Up @@ -139,19 +139,28 @@ describe("collect", function() {
})
})

afterAll(() => {
afterEach(() => {
mockFs.restore()
})

it("should traverse directory and collect messages", function() {
const { collect } = require("./extract")
const catalog = collect("src")
mockFs.restore()
expect(catalog).toMatchSnapshot()
})

it("should throw an error about different defaults", function() {
const { collect } = require("./extract")
expect(() => collect("diffDefaults")).toThrowErrorMatchingSnapshot()
try {
collect("diffDefaults")
} catch (e) {
// we have to call mockFs.restore *before* matching with snapshot
mockFs.restore()
expect(() => {
throw e
}).toThrowErrorMatchingSnapshot()
}
})
})

Expand Down
Loading

0 comments on commit e15e81d

Please sign in to comment.