Skip to content

Commit 7769cd6

Browse files
authored
Updating Tests to latest Prettier tests (#448)
* using defineProperty() instead of directly assigning run_spec to global * Using the latest run_spec for testing * fix call to run_spec and new snapshots * support for prettier/standalone in tests * running prettier * only collect coverage in FULL_TEST * cleaning up the scripts in package.json * adding testing to the README * .eslintignore and .prettierignore take care of the ignored folders now * Avoid using !!
1 parent 9ef89c4 commit 7769cd6

104 files changed

Lines changed: 9057 additions & 2333 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tests_config/**/*.js
2+
src/prettier-comments/**/*.js

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
tests/**/*.sol
2+
tests_config/**/*.js
3+
src/prettier-comments/**/*.js

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ If you want a different configuration for your javascript and solidity files, yo
152152
1. [Fork it](https://github.com/prettier-solidity/prettier-plugin-solidity/fork)
153153
2. Create your feature branch (`git checkout -b feature/fooBar`)
154154
3. Commit your changes (`git commit -am 'Add some fooBar'`)
155-
4. Push to the branch (`git push origin feature/fooBar`)
156-
5. Create a new Pull Request
155+
4. All existing test and coverage must pass (`npm run test:all`), if coverage drops below 100% add missing tests.
156+
5. Push to the branch (`git push origin feature/fooBar`)
157+
6. Create a new Pull Request
157158

158159
## License
159160

jest.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const FULL_TEST = Boolean(process.env.FULL_TEST);
2+
13
module.exports = {
2-
collectCoverage: true,
4+
collectCoverage: FULL_TEST,
35
collectCoverageFrom: [
46
'scripts/**/*.js',
57
'!scripts/generateIndexes.js',
@@ -16,8 +18,11 @@ module.exports = {
1618
statements: 100
1719
}
1820
},
19-
setupFiles: ['<rootDir>/tests_config/run_spec.js'],
20-
snapshotSerializers: ['<rootDir>/tests_config/raw-serializer.js'],
21+
setupFiles: ['<rootDir>/tests_config/setup.js'],
22+
snapshotSerializers: [
23+
'jest-snapshot-serializer-raw',
24+
'jest-snapshot-serializer-ansi'
25+
],
2126
testEnvironment: 'node',
2227
testRegex: 'jsfmt\\.spec\\.js$|__tests__/.*\\.js$|scripts/.*\\.test\\.js$',
2328
transform: {},

0 commit comments

Comments
 (0)