Skip to content

Commit

Permalink
ci(windows): add weird windows hack
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jun 29, 2017
1 parent 537781f commit 2c699c6
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
11 changes: 9 additions & 2 deletions test/unit/database.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ test.group('Database | QueryBuilder', (group) => {

group.after(async () => {
await helpers.dropTables(this.database)
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
console.log(error.code, process.plaform)
throw error
}
}
}).timeout(0)

test('get instance of query builder', (assert) => {
const queryBuilder = this.database.query()
Expand Down
10 changes: 8 additions & 2 deletions test/unit/lucid-belongs-to.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ test.group('Relations | Belongs To', (group) => {

group.after(async () => {
await helpers.dropTables(ioc.use('Adonis/Src/Database'))
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
throw error
}
}
}).timeout(0)

test('fetch related row via first method', async (assert) => {
class User extends Model {
Expand Down
10 changes: 8 additions & 2 deletions test/unit/lucid-has-many.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,14 @@ test.group('Relations | Has Many', (group) => {

group.after(async () => {
await helpers.dropTables(ioc.use('Adonis/Src/Database'))
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
throw error
}
}
}).timeout(0)

test('get instance of has many when calling to relation method', async (assert) => {
class Car extends Model {
Expand Down
10 changes: 8 additions & 2 deletions test/unit/lucid-relations.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ test.group('Relations | HasOne', (group) => {

group.after(async () => {
await helpers.dropTables(ioc.use('Adonis/Src/Database'))
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
throw error
}
}
}).timeout(0)

test('hasOne relation should make right query', async (assert) => {
class Profile extends Model {
Expand Down
10 changes: 8 additions & 2 deletions test/unit/lucid-serializer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ test.group('Relations | Serializer', (group) => {

group.after(async () => {
await helpers.dropTables(ioc.use('Adonis/Src/Database'))
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
throw error
}
}
}).timeout(0)

test('return serializer instance when returning multiple rows', async (assert) => {
class User extends Model {
Expand Down
10 changes: 8 additions & 2 deletions test/unit/lucid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,14 @@ test.group('Model', (group) => {

group.after(async () => {
await helpers.dropTables(ioc.use('Database'))
await fs.remove(path.join(__dirname, './tmp'))
})
try {
await fs.remove(path.join(__dirname, './tmp'))
} catch (error) {
if (process.plaform !== 'win32' || error.code !== 'EBUSY') {
throw error
}
}
}).timeout(0)

test('run queries using query builder', (assert) => {
class User extends Model {}
Expand Down

0 comments on commit 2c699c6

Please sign in to comment.