Skip to content

Commit

Permalink
build(dist): remove test folders from d.ts generation
Browse files Browse the repository at this point in the history
+ Ignore tests folders and files whem building
+ Ignore dist folder when running tests
+ Rename wrong test extension file
+ Add hook to run tests before pushing to master

BREAKING CHANGE: Ignore tests folders and files in build
Trigger tests before pushing to master
  • Loading branch information
samir-araujo committed Apr 1, 2020
1 parent d887af6 commit acf8bea
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion dist/__tests__/faker.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/helpers/__tests__/getLocale.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/helpers/__tests__/helpers.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/helpers/__tests__/randomArrayElement.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/helpers/__tests__/randomArrayElements.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/helpers/__tests__/randomNumber.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/name/__tests__/firstName.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/name/__tests__/name.test.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/name/firstName/locales/__tests__/locales.test.d.ts

This file was deleted.

3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'd.ts']
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'd.ts'],
modulePathIgnorePatterns: ['<rootDir>/dist/']
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
],
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true"
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-push": "branch=`git branch | grep \\* | cut -d ' ' -f2`;branchesToCheck=(\"master\"); [[ \" ${branchesToCheck[@]} \" =~ \" ${branch} \" ]] && yarn test || exit 0"
}
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@

/* Advanced Options */
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
}
},
"exclude": ["**/*.test.ts", "**/__tests__/*"]
}

0 comments on commit acf8bea

Please sign in to comment.