mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
Github/GitLab test: Try to guess where the test data is
The env in the CI seems to be a bit different
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:path/path.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
import 'package:gitjournal/apis/githost_factory.dart';
|
import 'package:gitjournal/apis/githost_factory.dart';
|
||||||
@ -9,7 +10,18 @@ import 'package:gitjournal/apis/github.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
test('Parse json', () async {
|
test('Parse json', () async {
|
||||||
print("Current Dir: ${Directory.current}");
|
print("Current Dir: ${Directory.current}");
|
||||||
var jsonString = File('test/apis/data/github.json').readAsStringSync();
|
var testDataPath = '';
|
||||||
|
|
||||||
|
var currentDir = Directory.current;
|
||||||
|
var folderName = basename(currentDir.path);
|
||||||
|
|
||||||
|
if (folderName == 'test') {
|
||||||
|
testDataPath = join(currentDir.path, 'apis/data/github.json');
|
||||||
|
} else {
|
||||||
|
testDataPath = join(currentDir.path, 'test/apis/data/github.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
var jsonString = File(testDataPath).readAsStringSync();
|
||||||
|
|
||||||
var api = GitHub();
|
var api = GitHub();
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:path/path.dart';
|
||||||
import 'package:test/test.dart';
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
import 'package:gitjournal/apis/githost_factory.dart';
|
import 'package:gitjournal/apis/githost_factory.dart';
|
||||||
@ -9,7 +10,18 @@ import 'package:gitjournal/apis/gitlab.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
test('Parse json', () async {
|
test('Parse json', () async {
|
||||||
print("Current Dir: ${Directory.current}");
|
print("Current Dir: ${Directory.current}");
|
||||||
var jsonString = File('test/apis/data/gitlab.json').readAsStringSync();
|
var testDataPath = '';
|
||||||
|
|
||||||
|
var currentDir = Directory.current;
|
||||||
|
var folderName = basename(currentDir.path);
|
||||||
|
|
||||||
|
if (folderName == 'test') {
|
||||||
|
testDataPath = join(currentDir.path, 'apis/data/gitlab.json');
|
||||||
|
} else {
|
||||||
|
testDataPath = join(currentDir.path, 'test/apis/data/gitlab.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
var jsonString = File(testDataPath).readAsStringSync();
|
||||||
|
|
||||||
var api = GitLab();
|
var api = GitLab();
|
||||||
|
|
||||||
|
@ -22,9 +22,8 @@
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
|
|
||||||
import 'package:markdown/markdown.dart' as md;
|
import 'package:markdown/markdown.dart' as md;
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
/// Parse [[term]]
|
/// Parse [[term]]
|
||||||
class _WikiLinkSyntax extends md.InlineSyntax {
|
class _WikiLinkSyntax extends md.InlineSyntax {
|
||||||
|
Reference in New Issue
Block a user