refactor: sort-files -> common utils
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
063145fe90
commit
88de5bc602
@ -14,7 +14,7 @@ import {
|
|||||||
} from '../redux';
|
} from '../redux';
|
||||||
import { userSelector, isDonationModalOpenSelector } from '../../../redux';
|
import { userSelector, isDonationModalOpenSelector } from '../../../redux';
|
||||||
import { Loader } from '../../../components/helpers';
|
import { Loader } from '../../../components/helpers';
|
||||||
import { sortFiles } from '../utils/sort-files';
|
import { sortFiles } from '../../../../../utils/sort-files';
|
||||||
|
|
||||||
import './editor.css';
|
import './editor.css';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export const challengeFiles = {
|
exports.challengeFiles = {
|
||||||
indexcss: {
|
indexcss: {
|
||||||
contents: 'some css',
|
contents: 'some css',
|
||||||
error: null,
|
error: null,
|
@ -1,4 +1,4 @@
|
|||||||
export function sortFiles(challengeFiles) {
|
exports.sortFiles = function sortFiles(challengeFiles) {
|
||||||
const xs = Object.values(challengeFiles);
|
const xs = Object.values(challengeFiles);
|
||||||
// TODO: refactor this to use an ext array ['html', 'js', 'css'] and loop over
|
// TODO: refactor this to use an ext array ['html', 'js', 'css'] and loop over
|
||||||
// that.
|
// that.
|
||||||
@ -12,4 +12,4 @@ export function sortFiles(challengeFiles) {
|
|||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
return xs;
|
return xs;
|
||||||
}
|
};
|
@ -22,6 +22,5 @@ describe('sort-files', () => {
|
|||||||
const expected = ['indexhtml', 'indexjsx', 'indexjs', 'indexcss'];
|
const expected = ['indexhtml', 'indexjsx', 'indexjs', 'indexcss'];
|
||||||
expect(sortedKeys).toStrictEqual(expected);
|
expect(sortedKeys).toStrictEqual(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
Reference in New Issue
Block a user