mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
add hook
This commit is contained in:
parent
dfc2cbff4f
commit
68b466502b
4
.githook/pre-commit
Executable file
4
.githook/pre-commit
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#flutter format .
|
||||
|
21
.githook/pre-push
Executable file
21
.githook/pre-push
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
cd flutter-lib
|
||||
if [[ `git status --porcelain` ]]; then
|
||||
printf "\e[31;1m%s\e[0m\n" 'This script needs to run against committed code only. Please commit or stash you changes.'
|
||||
exit 1
|
||||
fi
|
||||
printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer'
|
||||
flutter analyze
|
||||
if [ $? -ne 0 ]; then
|
||||
printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error'
|
||||
exit 1
|
||||
fi
|
||||
printf "\e[33;1m%s\e[0m\n" 'Finished running the Flutter analyzer'
|
||||
printf "\e[33;1m%s\e[0m\n" 'Running unit tests'
|
||||
|
||||
#flutter test
|
||||
#if [ $? -ne 0 ]; then
|
||||
# printf "\e[31;1m%s\e[0m\n" 'Unit tests error'
|
||||
# exit 1
|
||||
#fi
|
||||
#printf "\e[33;1m%s\e[0m\n" 'Finished running unit tests'
|
@ -16,6 +16,21 @@ fn sign_in_without_password() {
|
||||
dbg!(&result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn sign_in_with_invalid_password() {
|
||||
let params = UserSignInParams {
|
||||
email: "annie@appflowy.io".to_string(),
|
||||
password: "123".to_string(),
|
||||
};
|
||||
|
||||
let result = EventTester::new(SignIn)
|
||||
.payload(params)
|
||||
.assert_status_code(StatusCode::Err)
|
||||
.sync_send::<UserSignInResult>();
|
||||
dbg!(&result);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn sign_in_without_email() {
|
||||
|
Loading…
Reference in New Issue
Block a user