Skip to content

Commit

Permalink
Only snap error
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jun 17, 2024
1 parent fb53a07 commit 4da294a
Show file tree
Hide file tree
Showing 16 changed files with 648 additions and 65,537 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`add-assembly no load flag 1`] = `
{
"code": undefined,
"message": "Please specify the loading operation for this file with --load copy|symlink|move|inPlace",
"oclif": {
"exit": 110,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`add-assembly no load flag 1`] = `"Please specify the loading operation for this file with --load copy|symlink|move|inPlace"`;

exports[`adds an assembly from a 2bit 1`] = `
{
Expand Down Expand Up @@ -522,116 +512,23 @@ exports[`can use an existing config file 1`] = `
}
`;

exports[`fails if custom refNameAliases adapter has no type 1`] = `
{
"code": undefined,
"message": "No "type" specified in refNameAliases adapter "{}"",
"oclif": {
"exit": 150,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if custom refNameAliases adapter has no type 1`] = `"No "type" specified in refNameAliases adapter "{}""`;

exports[`fails if custom refNameAliases adapter has no type 2`] = `
{
"code": undefined,
"message": "No "type" specified in refNameAliases adapter "{}"",
"oclif": {
"exit": 150,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if custom refNameAliases adapter has no type 2`] = `"No "type" specified in refNameAliases adapter "{}""`;

exports[`fails if custom sequence adapter has no type 1`] = `
{
"code": undefined,
"message": "No "type" specified in sequence adapter "{}"",
"oclif": {
"exit": 140,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if custom sequence adapter has no type 1`] = `"No "type" specified in sequence adapter "{}""`;

exports[`fails if it cannot find a file 1`] = `
{
"code": undefined,
"message": "Could not resolve to a file or a URL: "simple.doesNotExist.fasta"",
"oclif": {
"exit": 40,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if it cannot find a file 1`] = `"Could not resolve to a file or a URL: "simple.doesNotExist.fasta""`;

exports[`fails if it cannot guess the sequence type 1`] = `
{
"code": undefined,
"message": "Could not determine sequence type automatically, add --type to specify it",
"oclif": {
"exit": 170,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if it cannot guess the sequence type 1`] = `"Could not determine sequence type automatically, add --type to specify it"`;

exports[`fails if load flag is passed with a URL 1`] = `
{
"code": undefined,
"message": "URL detected with --load flag. Please rerun the function without the --load flag",
"oclif": {
"exit": 120,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if load flag is passed with a URL 1`] = `"URL detected with --load flag. Please rerun the function without the --load flag"`;

exports[`fails if trying to add an assembly with a name that already exists 1`] = `
{
"code": undefined,
"message": "Cannot add assembly with name simple, an assembly with that name already exists",
"oclif": {
"exit": 160,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if trying to add an assembly with a name that already exists 1`] = `"Cannot add assembly with name simple, an assembly with that name already exists"`;

exports[`fails if using inline JSON sequence custom with no --name 1`] = `
{
"code": undefined,
"message": "Must provide --name when using custom inline JSON sequence",
"oclif": {
"exit": 130,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if using inline JSON sequence custom with no --name 1`] = `"Must provide --name when using custom inline JSON sequence"`;

exports[`fails if using invalid inline JSON 1`] = `
{
"code": undefined,
"message": "Error: ENOENT: no such file or directory, open 'notValidJSON'",
"oclif": {
"exit": 40,
},
"skipOclifErrorHandling": undefined,
"suggestions": [
"Make sure the file "notValidJSON" exists or use --out to point to a directory with a config.json",
"Run \`jbrowse add-assembly\` to create a config file",
],
}
`;
exports[`fails if using invalid inline JSON 1`] = `"Error: ENOENT: no such file or directory, open 'notValidJSON'"`;

exports[`relative path 1`] = `
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,204 +1,71 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`adds JBrowse1 connection from a url 1`] = `
{
"assemblies": [
{
"name": "testAssembly",
"sequence": {
"adapter": {
"twoBitLocation": {
"locationType": "UriLocation",
"uri": "test.2bit",
},
"type": "testSeqAdapter",
},
"trackId": "",
"type": "testSequenceTrack",
},
},
],
"configuration": {},
"connections": [
{
"connectionId": "JBrowse1Connection-1",
"dataDirLocation": {
"locationType": "UriLocation",
"uri": "https://mysite.com/jbrowse/data",
},
"name": "JBrowse1Connection-1",
"type": "JBrowse1Connection",
[
{
"connectionId": "JBrowse1Connection-1",
"dataDirLocation": {
"locationType": "UriLocation",
"uri": "https://mysite.com/jbrowse/data",
},
],
"defaultSession": {
"name": "New Session",
"name": "JBrowse1Connection-1",
"type": "JBrowse1Connection",
},
"tracks": [],
}
]
`;

exports[`adds a custom connection with user set fields 1`] = `
{
"assemblies": [
{
"name": "testAssembly",
"sequence": {
"adapter": {
"twoBitLocation": {
"locationType": "UriLocation",
"uri": "test.2bit",
},
"type": "testSeqAdapter",
},
"trackId": "",
"type": "testSequenceTrack",
},
},
],
"configuration": {},
"connections": [
{
"assemblyNames": [
"testAssembly",
],
"connectionId": "newConnectionId",
"locationType": "UriLocation",
"name": "newName",
"type": "newType",
"url": {
"uri": "https://mysite.com/custom",
},
[
{
"assemblyNames": [
"testAssembly",
],
"connectionId": "newConnectionId",
"locationType": "UriLocation",
"name": "newName",
"type": "newType",
"url": {
"uri": "https://mysite.com/custom",
},
],
"defaultSession": {
"name": "New Session",
},
"tracks": [],
}
]
`;

exports[`adds an UCSCTrackHubConnection connection from a url 1`] = `
{
"assemblies": [
{
"name": "testAssembly",
"sequence": {
"adapter": {
"twoBitLocation": {
"locationType": "UriLocation",
"uri": "test.2bit",
},
"type": "testSeqAdapter",
},
"trackId": "",
"type": "testSequenceTrack",
},
},
],
"configuration": {},
"connections": [
{
"connectionId": "UCSCTrackHubConnection-1",
"hubTxtLocation": {
"locationType": "UriLocation",
"uri": "https://mysite.com/data/hub.txt",
},
"name": "UCSCTrackHubConnection-1",
"type": "UCSCTrackHubConnection",
[
{
"connectionId": "UCSCTrackHubConnection-1",
"hubTxtLocation": {
"locationType": "UriLocation",
"uri": "https://mysite.com/data/hub.txt",
},
],
"defaultSession": {
"name": "New Session",
"name": "UCSCTrackHubConnection-1",
"type": "UCSCTrackHubConnection",
},
"tracks": [],
}
]
`;

exports[`fails if data directory is not an url 1`] = `
{
"code": undefined,
"message": "The location provided is not a valid URL",
"oclif": {
"exit": 160,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails if data directory is not an url 1`] = `"The location provided is not a valid URL"`;

exports[`fails if no config file 1`] = `
{
"code": undefined,
"message": "Error: ENOENT: no such file or directory, open './config.json'",
"oclif": {
"exit": 40,
},
"skipOclifErrorHandling": undefined,
"suggestions": [
"Make sure the file "./config.json" exists or use --out to point to a directory with a config.json",
"Run \`jbrowse add-assembly\` to create a config file",
],
}
`;
exports[`fails if no config file 1`] = `"Error: ENOENT: no such file or directory, open './config.json'"`;

exports[`fails to add a duplicate connection 1`] = `
{
"code": undefined,
"message": "Cannot add connection with id newConnectionId, a connection with that id already exists.
Use --overwrite if you would like to replace the existing connection",
"oclif": {
"exit": 150,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
"Cannot add connection with id newConnectionId, a connection with that id already exists.
Use --overwrite if you would like to replace the existing connection"
`;

exports[`fails when fetching from url fails 1`] = `
{
"code": undefined,
"message": "Unable to fetch from URL, Error: Response returned with code 500",
"oclif": {
"exit": 170,
},
"skipOclifErrorHandling": undefined,
"suggestions": undefined,
}
`;
exports[`fails when fetching from url fails 1`] = `"Unable to fetch from URL, Error: Response returned with code 500"`;

exports[`overwrites an existing custom connection and does not check URL 1`] = `
{
"assemblies": [
{
"name": "testAssembly",
"sequence": {
"adapter": {
"twoBitLocation": {
"locationType": "UriLocation",
"uri": "test.2bit",
},
"type": "testSeqAdapter",
},
"trackId": "",
"type": "testSequenceTrack",
},
},
],
"configuration": {},
"connections": [
{
"connectionId": "newConnectionId",
"locationType": "UriLocation",
"name": "newConnectionId",
"type": "custom",
"url": {
"uri": "https://mysite.com/custom",
},
[
{
"connectionId": "newConnectionId",
"locationType": "UriLocation",
"name": "newConnectionId",
"type": "custom",
"url": {
"uri": "https://mysite.com/custom",
},
],
"defaultSession": {
"name": "New Session",
},
"tracks": [],
}
]
`;
Loading

0 comments on commit 4da294a

Please sign in to comment.