Skip to content

Commit

Permalink
Add jest
Browse files Browse the repository at this point in the history
  • Loading branch information
plrdev committed Dec 25, 2019
1 parent 54d45dd commit 26996fc
Show file tree
Hide file tree
Showing 3 changed files with 1,034 additions and 96 deletions.
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
// The root of your source code, typically /src
// `<rootDir>` is a token Jest substitutes
roots: ["<rootDir>"],
preset: "react-native",

// Test spec file resolution pattern
// Matches parent folder `__tests__` and filename
// should contain `test` or `spec`.
testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",

// Module file extensions for importing
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$":
"jest-transform-stub"
},
testPathIgnorePatterns: ["/node_modules/", "./.vscode/", "examples"]
};
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "React-Native library to query and manage bluetooth state of the device (iOS and Android)",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"ci:test": "jest",
"test": "jest --passWithNoTests",
"ci:test": "jest --passWithNoTests",
"ci:publish": "yarn semantic-release",
"semantic-release": "semantic-release"
},
Expand Down Expand Up @@ -41,7 +41,8 @@
"semantic-release": "^15.14.0"
},
"dependencies": {
"@cs125/wait-until": "^0.0.3"
"@cs125/wait-until": "^0.0.3",
"jest": "^24.9.0"
},
"release": {
"plugins": [
Expand Down
Loading

0 comments on commit 26996fc

Please sign in to comment.