Skip to content

Commit

Permalink
remove hidden test for now
Browse files Browse the repository at this point in the history
  • Loading branch information
joehand committed Jan 12, 2017
1 parent d7115b6 commit 98166cb
Showing 1 changed file with 57 additions and 55 deletions.
112 changes: 57 additions & 55 deletions tests/sync-owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,61 +125,63 @@ test('sync-owner - imports after no-import create', function (t) {
st.end()
})

test('sync-owner - turn off ignore hidden', function (t) {
// cmd: dat sync
var hiddenFile = path.join(fixtures, '.hidden-file')
var cmd = dat + ' sync --no-ignore-hidden'
fs.writeFile(hiddenFile, 'You cannot see me', function (err) {
t.error(err)

var st = spawn(t, cmd, {cwd: fixtures, end: false})
var key

st.stdout.match(function (output) {
var sharing = output.indexOf('Dat Network') > -1
if (!sharing) return false

key = help.matchLink(output)

downloadDat()
return true
})
st.stderr.empty()
st.end()

function downloadDat () {
var downloadDir = path.join(help.testFolder(), '' + Date.now())
mkdirp.sync(downloadDir)

Dat(downloadDir, { key: key }, function (err, downDat) {
if (err) throw err

downDat.joinNetwork()

downDat.network.swarm.once('connection', function () {
downDat.archive.list({live: false}, function (err, data) {
t.error(err)
var hasHiddenFile = data.filter(function (entry) {
return entry.name === '.hidden-file'
})
t.ok(hasHiddenFile.length, 'hidden file in archive')
downDat.network.swarm.close(function () {
process.nextTick(function () {
downDat.close(function () {
rimraf(downDat.path, function () {
fs.unlink(hiddenFile, function () {
t.end()
})
})
})
})
})
})
})
})
}
})
})
// TODO: this test is causing serious memory issues.
// HELP. Maybe related to https://github.com/datproject/dat-node/issues/71
// test('sync-owner - turn off ignore hidden', function (t) {
// // cmd: dat sync
// var hiddenFile = path.join(fixtures, '.hidden-file')
// var cmd = dat + ' sync --no-ignore-hidden'
// fs.writeFile(hiddenFile, 'You cannot see me', function (err) {
// t.error(err)

// var st = spawn(t, cmd, {cwd: fixtures, end: false})
// var key

// st.stdout.match(function (output) {
// var sharing = output.indexOf('Dat Network') > -1
// if (!sharing) return false

// key = help.matchLink(output)

// downloadDat()
// return true
// })
// st.stderr.empty()
// st.end()

// function downloadDat () {
// var downloadDir = path.join(help.testFolder(), '' + Date.now())
// mkdirp.sync(downloadDir)

// Dat(downloadDir, { key: key }, function (err, downDat) {
// if (err) throw err

// downDat.joinNetwork()

// downDat.network.swarm.once('connection', function () {
// downDat.archive.list({live: false}, function (err, data) {
// t.error(err)
// var hasHiddenFile = data.filter(function (entry) {
// return entry.name === '.hidden-file'
// })
// t.ok(hasHiddenFile.length, 'hidden file in archive')
// downDat.network.swarm.close(function () {
// process.nextTick(function () {
// downDat.close(function () {
// rimraf(downDat.path, function () {
// fs.unlink(hiddenFile, function () {
// t.end()
// })
// })
// })
// })
// })
// })
// })
// })
// }
// })
// })

test('sync-owner - port and utp options', function (t) {
var port = 3281
Expand Down

0 comments on commit 98166cb

Please sign in to comment.