1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 13:10:09 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -7,6 +7,7 @@ const config = require('./config.json')
const fs = require('fs-extra')
const packager = require('../index')
const path = require('path')
const plist = require('plist')
const setup = require('./_setup')
const tempy = require('tempy')
const test = require('ava')
@@ -45,17 +46,32 @@ function testSinglePlatform (name, testFunction, testFunctionArgs, parallel) {
module.exports = {
allPlatformArchCombosCount: 9,
areFilesEqual: function areFilesEqual (file1, file2) {
let buffer1, buffer2
return fs.readFile(file1)
.then((data) => {
buffer1 = data
return fs.readFile(file2)
}).then((data) => {
buffer2 = data
return bufferEqual(buffer1, buffer2)
})
assertDirectory: function assertDirectory (t, pathToCheck, message) {
return fs.stat(pathToCheck)
.then(stats => t.true(stats.isDirectory(), message))
},
assertFile: function assertFile (t, pathToCheck, message) {
return fs.stat(pathToCheck)
.then(stats => t.true(stats.isFile(), message))
},
assertFilesEqual: function assertFilesEqual (t, file1, file2, message) {
return Promise.all([fs.readFile(file1), fs.readFile(file2)])
.then(([buffer1, buffer2]) => bufferEqual(buffer1, buffer2))
.then(equal => t.true(equal, message))
},
assertPathExistsCustom: function assertPathExistsCustom (t, pathToCheck, exists, message) {
return fs.pathExists(pathToCheck)
.then(result => t.is(exists, result, message))
},
assertPathExists: function assertPathExists (t, pathToCheck, message) {
return module.exports.assertPathExistsCustom(t, pathToCheck, true, message)
},
assertPathNotExists: function assertPathNotExists (t, pathToCheck, message) {
return module.exports.assertPathExistsCustom(t, pathToCheck, false, message)
},
assertSymlink: function assertFile (t, pathToCheck, message) {
return fs.lstat(pathToCheck)
.then(stats => t.true(stats.isSymbolicLink(), message))
},
fixtureSubdir: setup.fixtureSubdir,
generateResourcesPath: function generateResourcesPath (opts) {
@@ -72,11 +88,8 @@ module.exports = {
return packager(opts)
.then(paths => {
resourcesPath = path.join(paths[0], module.exports.generateResourcesPath(opts))
return fs.stat(resourcesPath)
}).then(stats => {
t.true(stats.isDirectory(), 'The output directory should contain the expected resources subdirectory')
return resourcesPath
})
return module.exports.assertDirectory(t, resourcesPath, 'The output directory should contain the expected resources subdirectory')
}).then(() => resourcesPath)
},
packagerTest: function packagerTest (name, testFunction, parallel) {
const testDefinition = parallel ? test : test.serial
@@ -88,6 +101,13 @@ module.exports = {
})
})
},
parsePlist: function parsePlist (t, appPath) {
const plistPath = path.join(appPath, 'Contents', 'Info.plist')
return module.exports.assertFile(t, plistPath, `The expected Info.plist should exist in ${path.basename(appPath)}`)
.then(() => fs.readFile(plistPath, 'utf8'))
.then(file => plist.parse(file))
},
singlePlatformOptions: function singlePlatformOptions () {
return {
platform: 'linux',
@@ -106,7 +126,7 @@ module.exports = {
return testSinglePlatform(name, testFunction, testFunctionArgs, true)
},
verifyPackageExistence: function verifyPackageExistence (finalPaths) {
return Promise.all(finalPaths.map((finalPath) => {
return Promise.all(finalPaths.map(finalPath => {
return fs.stat(finalPath)
.then(
stats => stats.isDirectory(),