Skip to content

Instantly share code, notes, and snippets.

@Nunocky
Created February 23, 2024 09:00
Show Gist options
  • Save Nunocky/27111e12751cefd2b349dc15ca1fe994 to your computer and use it in GitHub Desktop.
Save Nunocky/27111e12751cefd2b349dc15ca1fe994 to your computer and use it in GitHub Desktop.
http getを testで実行する
setUpAll(() => HttpOverrides.global = null);
test('http get', () async {
var url = Uri.https('official-joke-api.appspot.com', 'jokes/random');
var response = await http.get(url);
expect(response.statusCode, 200);
debugPrint(response.body);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment