a free (libre) open source, mobile OS for Ethereum https://status.app
Go to file
Icaro Motta 0b4a1545ae
Fix component tests, upgrade Jest & friends, and a few other goodies (#18276)
Fix all component tests after the latest RN upgrade.

Fixes https://github.com/status-im/status-mobile/issues/18157
Closes https://github.com/status-im/status-mobile/pull/18235

Dependency changes

- Upgraded Jest: from 26.6.3 to latest 29.7.0.
- Upgraded @testing-library/jest-native: from 5.3.0 to latest 5.4.3
- Upgraded @testing-library/react-native: from 11.5.4 to 12.4.2
- Removed explicit dependency on jest-circus, this is now the default test
  runner.
- Removed explicit dependency on jest-environment-node. This is handled by the
  package manager.
- Added jest-silent-reporter at version 0.5.0.

### Why component tests were failing?

Many tests were failing because we were using RN Testing Library (RNTL) in an
unreliable fashion. With the recent library upgrades, the unreliability was
excerbated. Other times, the tests were incorrectly arranging data.

### with-redefs does not work with async code

Generally speaking, with-redefs should not be used with async code, assume the
worst. The scope of the macro will cease to exist by the time the async code
runs. In many tests we were using with-redefs, then calling render, but for some
components that use use-effect, JS timers, animations, etc it's unreliable and
were the reason for failures.

It's easy to reproduce too:

```clojure
(defn foo []
  :foo)

(foo)
;; => :foo

(with-redefs [foo (constantly :bar)]
  (foo))
;; => :bar

(js/setTimeout
 (fn []
   (tap> [:calling-foo (foo)]))
 100)
;; Taps [:calling-foo :foo]
;; As you would expect, when running without with-redefs, it prints :foo.

;; So far so good, but whatch what happens with async code:

(with-redefs [foo (constantly :bar)]
  (js/setTimeout
   (fn []
     (tap> [:calling-foo (foo)]))
   100))
;; Taps [:calling-foo :foo]
;; ====> PROBLEM: Taps :foo, not :bar as one might expect
```

### Not waiting on wait-for

When test-helpers.component/wait-for is used, subsequent assertions/etc should
be done after the promise returned by wait-for is resolved. But remember to not
perform side-effects inside the wait-for callback (check out the docs
https://callstack.github.io/react-native-testing-library/docs/api#waitfor).
Most, if not all of our usages of wait-for were not waiting.

#### Improvement 1 - Silence Jest on demand

If you need to re-run component tests frequently, you may want to reduce the
output verbosity. By passing JEST_USE_SILENT_REPORTER=true to make
component-test or make component-test-watch you will see a lot less noise and be
able to focus on what really matters to you.

#### Improvement 2 - Selectively focus/disable tests

Because of our need to first compile CLJS to JS before running tests via Jest,
we couldn't easily skip or focus on specific tests. From this commit onwards, we
should never again have to change the list of requires in files core_spec.cljs.
Commenting out required namespaces gives a bad DX because it causes constant
rebasing issues.

#### Improvement 3 - Translations now work as in prod code (but only English)

Translations performed by *-by-translation-text can be done now without any
workaround under the hood. The query functions are now linted just like
i18n/label, which means static translation keywords must be qualified with :t/,
which is good for consistency.
2023-12-26 11:58:23 -03:00
.clj-kondo Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
.dependabot [Fixes: #11518] Fix dependabot directory 2020-12-07 12:14:16 +01:00
.github Adjust PR template to add before/after (#17402) 2023-09-25 13:42:37 +03:00
.lsp chore: add lsp clean-ns in lint-fix (#17661) 2023-10-18 00:17:43 +08:00
.vscode Document how to auto-format Clojure files in VSCode with zprint (#17719) 2023-10-25 23:19:56 -03:00
android Fix crash on x86_64 emulators (#17773) 2023-12-19 20:11:25 +05:30
ci apk name updated in e2e nightly jenkins file 2023-12-22 16:18:00 +02:00
doc Improve test failure readability (#18049) 2023-12-05 17:20:54 -03:00
fastlane ios: drop fastlane-plugin-clean_testflight_testers 2023-05-24 11:52:01 +02:00
ios Upgrade react-native-reanimated to 3.6.1 (#18216) 2023-12-18 09:44:53 +05:30
modules/react-native-status Add fetch messages behind a toggle & some advanced settings 2023-12-20 13:04:29 +00:00
nix Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
resources chore: add outline for transacation-progress page (#18217) 2023-12-21 15:37:18 +00:00
scripts Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
src Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
test Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
test-resources Update prettier config for the project. (#16303) 2023-06-19 19:09:12 +05:30
translations Wallet: best route UI (#18266) 2023-12-22 09:40:43 +04:00
.buckconfig
.carve_ignore FINAL BOSS! rename status-im2 to status-im (#18241) 2023-12-19 20:59:07 +01:00
.dockerignore Create Nix package for building status-go 2019-04-09 12:44:39 +02:00
.env Remove options to create community from mobile from release and nightly builds (#17495) 2023-10-04 15:12:16 +05:30
.env.e2e Add method for fast creation of communities (#16806) 2023-08-03 08:59:28 +08:00
.env.jenkins Add method for fast creation of communities (#16806) 2023-08-03 08:59:28 +08:00
.env.nightly Add method for fast creation of communities (#16806) 2023-08-03 08:59:28 +08:00
.env.release Remove options to create community from mobile from release and nightly builds (#17495) 2023-10-04 15:12:16 +05:30
.envrc Add login integration test 2022-06-08 13:43:32 +01:00
.eslintrc.js upgrade react-native to 0.72.5 (#17241) 2023-12-11 21:22:23 +05:30
.flowconfig RN 63 and xcode12 2021-01-14 09:41:38 +01:00
.gitattributes Desktop branch merged into develop (#5266) 2018-07-23 18:21:31 +03:00
.gitignore upgrade react-native to 0.72.5 (#17241) 2023-12-11 21:22:23 +05:30
.mailmap fix my name 2019-02-28 14:50:42 +01:00
.nycrc move status-im under legacy (#18237) 2023-12-19 18:41:30 +01:00
.prettierignore feat: lint direct require quo component outside src/quo (#17828) 2023-11-07 10:21:58 +08:00
.prettierrc.js Update prettier config for the project. (#16303) 2023-06-19 19:09:12 +05:30
.watchmanconfig Ensure shell.nix uses same nixpkgs as the rest of the environment 2019-06-20 09:18:24 -04:00
.zprintrc Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:44 +08:00
Makefile Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
README.md Fixed Some Grammatical Errors in README.md (#17716) 2023-10-27 13:17:16 +05:30
RELEASES.md rename quo2 (#17660) 2023-10-17 17:27:18 +02:00
VERSION Bump release to 1.25.0 (#17247) 2023-09-11 14:42:15 +01:00
app.json Lint and fix missing trailing newlines (#16445) 2023-07-04 19:40:13 +00:00
babel.config.js upgrade react-native to 0.72.5 (#17241) 2023-12-11 21:22:23 +05:30
binding.gyp Add status-go tests 2022-05-25 17:59:02 +01:00
default.nix nix: minor cleanup and documentation updates 2020-06-05 14:49:34 +02:00
index.js Update prettier config for the project. (#16303) 2023-06-19 19:09:12 +05:30
metro.config.js upgrade react-native to 0.72.5 (#17241) 2023-12-11 21:22:23 +05:30
package.json Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
react-native.config.js upgrade react-native to 0.72.5 (#17241) 2023-12-11 21:22:23 +05:30
shadow-cljs.edn Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00
shell.nix nix: minor cleanup and documentation updates 2020-06-05 14:49:34 +02:00
status-go-version.json chore: update status-go version (#18253) 2023-12-23 10:08:49 +05:30
supervisord.conf Add docker-compose for development build 2018-04-11 14:58:38 +01:00
yarn.lock Fix component tests, upgrade Jest & friends, and a few other goodies (#18276) 2023-12-26 11:58:23 -03:00

README.md

Status - a Mobile Ethereum Operating System

Get it on Google Play Get it on F-Droid

Get it on Github

Join us in creating a browser, messenger, and gateway to a decentralized world. Status is a free (libre) open source mobile client targeting Android & iOS built entirely on Ethereum technologies. That's right, no middlemen and go-ethereum running directly on your device.

Getting started with Status

Why?

We believe in a medium of pure free trade, economies with fair, permission-less access and a world without intermediaries. We want to create policies that can exist between friends or scale globally, we want to communicate securely and be uninhibited by legacy systems.

We want to take responsibility for our data, and the way we conduct ourselves privately and promote this way of life to a mass audience.

We want deep insights into our own economies so we can make informed, data-driven decisions on how to make our lives better. The Ethereum blockchain, Smart Contracts, Swarm and Whisper provide us with a path forward.

If this interests you, help us make Status a reality - anyone can contribute and we need everyone at any skill level to participate.

How to Contribute?

Go straight to the docs and choose what interests you:

  • Developer Developers are the heart of software and to keep Status beating we need all the help we can get! If you're looking to code in ClojureScript or Golang then Status is the project for you! We use React Native and there is even some Java/Objective-C too! Want to learn more about it? Start by reading our Developer Introduction which guides you through the technology stack and start browsing beginner issues. Then you can read how to Build Status, which talks about managing project dependencies, coding guidelines and testing procedures. Check out our coding guidelines.

  • Community Management Metcalfe's law states that the value of a network is proportional to the square of the number of connected users of the system - without community Status is meaningless. We're looking to create a positive, fun environment to explore new ideas, experiment and grow the Status community. Building a community takes a lot of work but the people you'll meet and the long-lasting relationships you form will be well worth it, check out our Mission and Community Principles

  • Specification / Documentation John Dewey once said, "Education is not preparation for life; education is life itself ". Developers and Designers need guidance and it all starts from documentation and specifications. Our software is only as good as its documentation, check out our docs and see how you can improve what we have.

  • Blog Writing Content is King, keeping our blog up to date and informing the community of news helps keep everyone on the same page.

  • Testers It's bug-hunting season! Status is currently under active development and there is sure to be a bunch of learning, build status from scratch or if an android user checks out our nightly builds. You can shake your phone to submit bug reports, or start browsing our Github Issues. Every bug you find brings Status closer to stable, usable software for everyone to enjoy!

  • Security Status is a visual interface to make permanent changes on the Blockchain, it handles crypto-tokens that have real value and allows 3rd party code execution. Security is paramount to its success. You are given permission to break Status as hard as you can, as long as you share your findings with the community!

  • Evangelism Help us spread the word! Tell a friend right now, in fact, tell everyone - yell from a mountain if you have to, every person counts! If you've got a great story to tell or have some interesting way you've spread the word about Status let us know about it in our chat

Give me Binaries!

You can get our Beta builds for both Android and iOS on our website, through our nightly builds, or by building it yourself.

Core Contributors

Core Team Members

Special thanks to @adrian-tiberius. Without the dedication of these outstanding individuals, Status would not exist.

Contact us

Feel free to email us at support@status.im.

License

Licensed under the Mozilla Public License v2.0