-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[STUD-414] Make all tests work with Stardog 7+ (#234)"
This reverts commit f4f77f1.
- Loading branch information
Jason Rogers
committed
Oct 21, 2020
1 parent
27beed6
commit 9467507
Showing
9 changed files
with
214 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-env jest */ | ||
|
||
const { db } = require('../lib'); | ||
const { | ||
seedDatabase, | ||
dropDatabase, | ||
generateDatabaseName, | ||
ConnectionFactory, | ||
} = require('./setup-database'); | ||
|
||
describe('db.copy()', () => { | ||
const sourceDatabase = generateDatabaseName(); | ||
const destinationDatabase = generateDatabaseName(); | ||
let conn; | ||
|
||
beforeAll(seedDatabase(sourceDatabase)); | ||
afterAll(dropDatabase(sourceDatabase)); | ||
afterAll(dropDatabase(destinationDatabase)); | ||
|
||
beforeEach(() => { | ||
conn = ConnectionFactory(); | ||
}); | ||
|
||
it('should not copy an online DB', () => | ||
db | ||
.copy(conn, sourceDatabase, destinationDatabase) | ||
.then(() => db.list(conn)) | ||
.then(res => { | ||
expect(res.status).toEqual(200); | ||
// Destination shouldn't be listed because it's not online yet and therefor didn't get copied. | ||
expect(res.body.databases).not.toContain(destinationDatabase); | ||
expect(res.body.databases).toContain(sourceDatabase); | ||
})); | ||
|
||
it('should copy an offline DB', () => | ||
db | ||
.offline(conn, sourceDatabase) | ||
.then(() => db.copy(conn, sourceDatabase, destinationDatabase)) | ||
.then(() => db.list(conn)) | ||
.then(res => { | ||
expect(res.status).toEqual(200); | ||
expect(res.body.databases).toContain(destinationDatabase); | ||
expect(res.body.databases).toContain(sourceDatabase); | ||
})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.