mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Updated make files/scripts to accomodate execution/building in windows in addition to linux/mac (#4135)
This commit is contained in:
committed by
Christopher Speller
parent
1a5a624470
commit
3bac3a0061
@@ -9,16 +9,17 @@ const fs = require('fs');
|
||||
describe('Client.Emoji', function() {
|
||||
this.timeout(100000);
|
||||
|
||||
const testGifFileName = 'testEmoji.gif';
|
||||
|
||||
before(function() {
|
||||
// write a temporary file so that we have something to upload for testing
|
||||
const buffer = new Buffer('R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=', 'base64');
|
||||
|
||||
const testGif = fs.openSync('test.gif', 'w+');
|
||||
const testGif = fs.openSync(testGifFileName, 'w+');
|
||||
fs.writeFileSync(testGif, buffer);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
fs.unlinkSync('test.gif');
|
||||
fs.unlinkSync(testGifFileName);
|
||||
});
|
||||
|
||||
it('addEmoji', function(done) {
|
||||
@@ -27,7 +28,7 @@ describe('Client.Emoji', function() {
|
||||
|
||||
TestHelper.basicClient().addEmoji(
|
||||
{creator_id: TestHelper.basicUser().id, name},
|
||||
fs.createReadStream('test.gif'),
|
||||
fs.createReadStream(testGifFileName),
|
||||
function(data) {
|
||||
assert.equal(data.name, name);
|
||||
assert.notEqual(data.id, null);
|
||||
@@ -46,7 +47,7 @@ describe('Client.Emoji', function() {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().addEmoji(
|
||||
{creator_id: TestHelper.basicUser().id, name: TestHelper.generateId()},
|
||||
fs.createReadStream('test.gif'),
|
||||
fs.createReadStream(testGifFileName),
|
||||
function(data) {
|
||||
TestHelper.basicClient().deleteEmoji(
|
||||
data.id,
|
||||
@@ -70,7 +71,7 @@ describe('Client.Emoji', function() {
|
||||
const name = TestHelper.generateId();
|
||||
TestHelper.basicClient().addEmoji(
|
||||
{creator_id: TestHelper.basicUser().id, name},
|
||||
fs.createReadStream('test.gif'),
|
||||
fs.createReadStream(testGifFileName),
|
||||
function() {
|
||||
TestHelper.basicClient().listEmoji(
|
||||
function(data) {
|
||||
|
||||
@@ -9,16 +9,18 @@ const fs = require('fs');
|
||||
describe('Client.File', function() {
|
||||
this.timeout(100000);
|
||||
|
||||
const testGifFileName = 'testFile.gif';
|
||||
|
||||
before(function() {
|
||||
// write a temporary file so that we have something to upload for testing
|
||||
const buffer = new Buffer('R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=', 'base64');
|
||||
|
||||
const testGif = fs.openSync('test.gif', 'w+');
|
||||
const testGif = fs.openSync(testGifFileName, 'w+');
|
||||
fs.writeFileSync(testGif, buffer);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
fs.unlinkSync('test.gif');
|
||||
fs.unlinkSync(testGifFileName);
|
||||
});
|
||||
|
||||
it('uploadFile', function(done) {
|
||||
@@ -26,8 +28,8 @@ describe('Client.File', function() {
|
||||
const clientId = TestHelper.generateId();
|
||||
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
clientId,
|
||||
function(resp) {
|
||||
@@ -47,8 +49,8 @@ describe('Client.File', function() {
|
||||
it('getFile', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
@@ -72,8 +74,8 @@ describe('Client.File', function() {
|
||||
it('getFileThumbnail', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
@@ -97,8 +99,8 @@ describe('Client.File', function() {
|
||||
it('getFilePreview', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
@@ -122,8 +124,8 @@ describe('Client.File', function() {
|
||||
it('getFileInfo', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
@@ -133,7 +135,7 @@ describe('Client.File', function() {
|
||||
fileId,
|
||||
function(info) {
|
||||
assert.equal(info.id, fileId);
|
||||
assert.equal(info.name, 'test.gif');
|
||||
assert.equal(info.name, testGifFileName);
|
||||
|
||||
done();
|
||||
},
|
||||
@@ -152,8 +154,8 @@ describe('Client.File', function() {
|
||||
it('getPublicLink', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
@@ -206,8 +208,8 @@ describe('Client.File', function() {
|
||||
it('getFileInfosForPost', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().uploadFile(
|
||||
fs.createReadStream('test.gif'),
|
||||
'test.gif',
|
||||
fs.createReadStream(testGifFileName),
|
||||
testGifFileName,
|
||||
TestHelper.basicChannel().id,
|
||||
'',
|
||||
function(resp) {
|
||||
|
||||
Reference in New Issue
Block a user