Skip to content

Commit

Permalink
Rename upload-sms-from-csv command
Browse files Browse the repository at this point in the history
  • Loading branch information
alxndrsn committed May 8, 2018
1 parent 06f78d6 commit 4c0ccba
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "medic-conf",
"version": "1.14.0",
"version": "1.14.1",
"description": "Configure Medic Mobile deployments",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/cli/supported-actions.js
Expand Up @@ -10,7 +10,6 @@ module.exports = [
'convert-contact-forms',
'create-users',
'csv-to-docs',
'csv-to-sms',
'delete-forms',
'delete-all-forms',
'fetch-forms-from-google-drive',
Expand All @@ -22,4 +21,5 @@ module.exports = [
'upload-custom-translations',
'upload-docs',
'upload-resources',
'upload-sms-from-csv',
];
2 changes: 1 addition & 1 deletion src/fn/csv-to-sms.js → src/fn/upload-sms-from-csv.js
Expand Up @@ -7,7 +7,7 @@ module.exports = (projectDir, couchUrl, extras) => {
const instanceUrl = couchUrl.replace(/\/medic$/, '');
const csvFiles = extras || ['sms.csv'];

trace('csv-to-sms', 'csv files:', csvFiles);
trace('upload-sms-from-csv', 'csv files:', csvFiles);

return csvFiles.map(fileName => `${projectDir}/${fileName}`)
.reduce((promiseChain, csvFile) => {
Expand Down
3 changes: 2 additions & 1 deletion test/bin/shell-completion.spec.js
Expand Up @@ -36,7 +36,8 @@ describe('shell-completion', () => {
'upload-contact-forms',
'upload-custom-translations',
'upload-docs',
'upload-resources');
'upload-resources',
'upload-sms-from-csv');

});

Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,19 +1,19 @@
const api = require('../api-stub');
const fs = require('../../src/lib/sync-fs');
const csvToSms = require('../../src/fn/csv-to-sms');
const csvToSms = require('../../src/fn/upload-sms-from-csv');

const chai = require('chai');
chai.use(require('chai-exclude'));
const assert = chai.assert;

describe('csv-to-sms', function() {
describe('upload-sms-from-csv', function() {
beforeEach(api.start);
afterEach(api.stop);

it('should upload SMS supplied in CSV format to medic-api', function() {

// given
const testDir = 'data/csv-to-sms';
const testDir = 'data/upload-sms-from-csv';

// when
return csvToSms(testDir, api.couchUrl)
Expand Down

0 comments on commit 4c0ccba

Please sign in to comment.