For revision (md-links) Dianyela Maldonado este si, ya lo terminé :D -->burguer queen please #39
For revision (md-links) Dianyela Maldonado este si, ya lo terminé :D -->burguer queen please #39DianyelaMaldonado wants to merge 22 commits into
Conversation
…d--a-file Add function to read files and started function to check it is markdown file in app.js
…king tests of executable so far this is a test. add chnages in package.json, add new file didi-mdlinks
…-a-markdown-file Added read file function app.js and a cli.js file will be executed ma…
…ontinue-cli-trials Changes were made in app.j. Getting links works, cli proofs of concep…
…em into arrow functions: (isMarkDown, showLinks, readFile).
…e-order-and-functionality-of-functions Correction of functions that were out of order in app.js. I turned th…
Pull Request about corrections
… until twenty five line. Now i begin to work in function of check the links status
…heckLinkStatus, this for i can see the links brokens and the links functionals
…hat-work-and-those-that-don't Feature/getting links that work and those that don't
…or the future testing of functions
…hat-work-and-those-that-don't I create folder called test, and i create a file called mdlink.spec f…
…hat-work-and-those-that-don't App.js was edited and a new statistics function was created
Feature/testing
finish changes about test. All ok
|
|
||
| //The app must read a file | ||
| const readFile = () => { | ||
| let index = process.argv.indexOf("--file"); //flag--> --file |
There was a problem hiding this comment.
Súper bien! Por favor, solo borra el comentario.
|
|
||
| //finding links | ||
| const showLinks = (fileInformation) => { | ||
| console.log("all the information contained in the md file", fileInformation); |
| return Promise.all(promises) | ||
| .then(res => { | ||
| arrayCount(res) | ||
|
|
| readFile | ||
| } = require("./app.js") | ||
|
|
||
| readFile(); No newline at end of file |
There was a problem hiding this comment.
Me parece que este archivo no lo veo necesario, para qué lo estás utilizando?
There was a problem hiding this comment.
Debo quitarlo 🧛 se me paso el borrarlo, muchas gracias adri.
| @@ -0,0 +1,2 @@ | |||
| {"C:\\Users\\Danna\\Documents\\CDMX009-MdLinks\\app.js": {"path":"C:\\Users\\Danna\\Documents\\CDMX009-MdLinks\\app.js","statementMap":{"0":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}},"1":{"start":{"line":2,"column":11},"end":{"line":2,"column":24}},"2":{"start":{"line":3,"column":14},"end":{"line":3,"column":35}},"3":{"start":{"line":4,"column":15},"end":{"line":4,"column":37}},"4":{"start":{"line":7,"column":19},"end":{"line":7,"column":68}},"5":{"start":{"line":7,"column":26},"end":{"line":7,"column":68}},"6":{"start":{"line":10,"column":17},"end":{"line":18,"column":1}},"7":{"start":{"line":11,"column":16},"end":{"line":11,"column":46}},"8":{"start":{"line":12,"column":4},"end":{"line":12,"column":68}},"9":{"start":{"line":12,"column":19},"end":{"line":12,"column":68}},"10":{"start":{"line":13,"column":14},"end":{"line":13,"column":37}},"11":{"start":{"line":14,"column":4},"end":{"line":17,"column":5}},"12":{"start":{"line":15,"column":30},"end":{"line":15,"column":58}},"13":{"start":{"line":16,"column":8},"end":{"line":16,"column":35}},"14":{"start":{"line":21,"column":18},"end":{"line":26,"column":1}},"15":{"start":{"line":22,"column":4},"end":{"line":22,"column":81}},"16":{"start":{"line":23,"column":16},"end":{"line":23,"column":83}},"17":{"start":{"line":24,"column":17},"end":{"line":24,"column":45}},"18":{"start":{"line":25,"column":4},"end":{"line":25,"column":28}},"19":{"start":{"line":29,"column":24},"end":{"line":63,"column":1}},"20":{"start":{"line":30,"column":19},"end":{"line":55,"column":5}},"21":{"start":{"line":30,"column":40},"end":{"line":54,"column":10}},"22":{"start":{"line":32,"column":31},"end":{"line":36,"column":13}},"23":{"start":{"line":37,"column":12},"end":{"line":41,"column":13}},"24":{"start":{"line":38,"column":16},"end":{"line":38,"column":100}},"25":{"start":{"line":40,"column":16},"end":{"line":40,"column":100}},"26":{"start":{"line":42,"column":12},"end":{"line":42,"column":31}},"27":{"start":{"line":45,"column":22},"end":{"line":49,"column":13}},"28":{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},"29":{"start":{"line":51,"column":16},"end":{"line":51,"column":94}},"30":{"start":{"line":53,"column":12},"end":{"line":53,"column":22}},"31":{"start":{"line":57,"column":4},"end":{"line":61,"column":10}},"32":{"start":{"line":59,"column":12},"end":{"line":59,"column":27}},"33":{"start":{"line":67,"column":4},"end":{"line":67,"column":68}},"34":{"start":{"line":68,"column":4},"end":{"line":73,"column":11}},"35":{"start":{"line":69,"column":8},"end":{"line":71,"column":9}},"36":{"start":{"line":70,"column":12},"end":{"line":70,"column":34}},"37":{"start":{"line":72,"column":8},"end":{"line":72,"column":25}},"38":{"start":{"line":74,"column":4},"end":{"line":79,"column":11}},"39":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"40":{"start":{"line":76,"column":12},"end":{"line":76,"column":34}},"41":{"start":{"line":78,"column":8},"end":{"line":78,"column":25}},"42":{"start":{"line":81,"column":4},"end":{"line":81,"column":14}},"43":{"start":{"line":84,"column":0},"end":{"line":90,"column":1}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":7,"column":19},"end":{"line":7,"column":20}},"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":68}},"line":7},"1":{"name":"(anonymous_1)","decl":{"start":{"line":10,"column":17},"end":{"line":10,"column":18}},"loc":{"start":{"line":10,"column":23},"end":{"line":18,"column":1}},"line":10},"2":{"name":"(anonymous_2)","decl":{"start":{"line":21,"column":18},"end":{"line":21,"column":19}},"loc":{"start":{"line":21,"column":39},"end":{"line":26,"column":1}},"line":21},"3":{"name":"(anonymous_3)","decl":{"start":{"line":29,"column":24},"end":{"line":29,"column":25}},"loc":{"start":{"line":29,"column":38},"end":{"line":63,"column":1}},"line":29},"4":{"name":"(anonymous_4)","decl":{"start":{"line":30,"column":32},"end":{"line":30,"column":33}},"loc":{"start":{"line":30,"column":40},"end":{"line":54,"column":10}},"line":30},"5":{"name":"(anonymous_5)","decl":{"start":{"line":31,"column":14},"end":{"line":31,"column":15}},"loc":{"start":{"line":31,"column":21},"end":{"line":43,"column":9}},"line":31},"6":{"name":"(anonymous_6)","decl":{"start":{"line":44,"column":15},"end":{"line":44,"column":16}},"loc":{"start":{"line":44,"column":24},"end":{"line":54,"column":9}},"line":44},"7":{"name":"(anonymous_7)","decl":{"start":{"line":58,"column":14},"end":{"line":58,"column":15}},"loc":{"start":{"line":58,"column":21},"end":{"line":61,"column":9}},"line":58},"8":{"name":"arrayCount","decl":{"start":{"line":66,"column":9},"end":{"line":66,"column":19}},"loc":{"start":{"line":66,"column":25},"end":{"line":82,"column":1}},"line":66},"9":{"name":"(anonymous_9)","decl":{"start":{"line":68,"column":60},"end":{"line":68,"column":61}},"loc":{"start":{"line":68,"column":85},"end":{"line":73,"column":5}},"line":68},"10":{"name":"(anonymous_10)","decl":{"start":{"line":74,"column":57},"end":{"line":74,"column":58}},"loc":{"start":{"line":74,"column":82},"end":{"line":79,"column":5}},"line":74}},"branchMap":{"0":{"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":68}},"type":"cond-expr","locations":[{"start":{"line":7,"column":56},"end":{"line":7,"column":60}},{"start":{"line":7,"column":63},"end":{"line":7,"column":68}}],"line":7},"1":{"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":68}},"type":"if","locations":[{"start":{"line":12,"column":4},"end":{"line":12,"column":68}},{"start":{"line":12,"column":4},"end":{"line":12,"column":68}}],"line":12},"2":{"loc":{"start":{"line":14,"column":4},"end":{"line":17,"column":5}},"type":"if","locations":[{"start":{"line":14,"column":4},"end":{"line":17,"column":5}},{"start":{"line":14,"column":4},"end":{"line":17,"column":5}}],"line":14},"3":{"loc":{"start":{"line":37,"column":12},"end":{"line":41,"column":13}},"type":"if","locations":[{"start":{"line":37,"column":12},"end":{"line":41,"column":13}},{"start":{"line":37,"column":12},"end":{"line":41,"column":13}}],"line":37},"4":{"loc":{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},"type":"if","locations":[{"start":{"line":50,"column":12},"end":{"line":52,"column":13}},{"start":{"line":50,"column":12},"end":{"line":52,"column":13}}],"line":50},"5":{"loc":{"start":{"line":69,"column":8},"end":{"line":71,"column":9}},"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":71,"column":9}},{"start":{"line":69,"column":8},"end":{"line":71,"column":9}}],"line":69},"6":{"loc":{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":77,"column":9}},{"start":{"line":75,"column":8},"end":{"line":77,"column":9}}],"line":75}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":2,"6":1,"7":1,"8":1,"9":1,"10":0,"11":0,"12":0,"13":0,"14":1,"15":1,"16":1,"17":1,"18":0,"19":1,"20":1,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":1,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":1},"f":{"0":2,"1":1,"2":1,"3":1,"4":0,"5":0,"6":0,"7":0,"8":1,"9":0,"10":0},"b":{"0":[1,1],"1":[1,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"03996bb04d781225df0409b72f9b4411d3267655"} | |||
| } | |||
There was a problem hiding this comment.
Me parece que estos archivos no deberían estar arriba
| BRDA:75,6,1,0 | ||
| BRF:14 | ||
| BRH:3 | ||
| end_of_record |
There was a problem hiding this comment.
Todos estos archivos de coverage no deberían estar en el repo.
There was a problem hiding this comment.
Siii, se supone los había eliminado ⚡ pero cuando hice el push se guardaron 🦖 , también debo quitarlos
|
|
||
| describe('readFile', () => { | ||
| it('Should Get all links of the file', () => { | ||
| expect(readFile()).toBe(undefined); |
There was a problem hiding this comment.
Por qué aquí tendría que ser undefined?
There was a problem hiding this comment.
Porque el la consola me sale que lo que se espera que sea, es undefined 📟
| describe('isMarkDown', () => { | ||
| it('Should return false if it is not an .md file', () => { | ||
| expect(isMarkDown(badPath)).toBe(false); | ||
| }); |
There was a problem hiding this comment.
Intenta también hacer la función en donde el archivo si sea md
| describe('isMarkDown', () => { | ||
| it('Should return true if it is an .md file', () => { | ||
| expect(isMarkDown(path)).toBe(true); | ||
| }); |
| }); | ||
| describe('checkLinkStatus', () => { | ||
| it('Should retur err if links are not found in the file', () => { | ||
| expect(() => checkLinkStatus()).toThrow(Error); |
There was a problem hiding this comment.
Por qué es una función que regresa una función?
There was a problem hiding this comment.
Así lo vi en un ejemplo de documentación que estaba revisando, así venía la sintaxis, ando todavía en el proceso de testear desde lo básico, cualquier cosa lo checamos 💇
|
|
||
| describe('arrayCount', () => { | ||
| it('Should retur err if links are not found in the file', () => { | ||
| expect(() => arrayCount()).toThrow(Error); |
|
|
||
| describe('showLinks', () => { | ||
| it('Should return an array with the links that the file content ', () => { | ||
| expect(() => showLinks()).toThrow(Error); |
AdrianaHY
left a comment
There was a problem hiding this comment.
Excelente trabajo Dian!!! Me alegra mucho ver todo lo que has progresado y lo mucho que hiciste ne este proyecto. Solo te recomiendo seguir practicando testing, por favor checa las preguntas que te dejé en tus tests. Muy buen trabajo!
No description provided.