One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| const palindrome = (words) => { | |
| if (typeof words !== 'string') return 'provide a string or a phrase'; | |
| const wordArray = words.replace(/([^\w])/g, '').split(''); | |
| return checkPalindrome(wordArray); | |
| } | |
| function checkPalindrome(arrayOfChars) { | |
| if (!Array.isArray(arrayOfChars)) return 'please provide an array'; | |
| if (arrayOfChars.join('') === arrayOfChars.reverse().join('')) return 'this is a palindrome'; | |
| return 'this is not a palindrome'; |
| updateArticle (req, res); | |
| updateArticle => | |
| const { tags, title, description, body, images } = res.body; | |
| const updatedArticle = Articles.update( | |
| { tags, title, description, body, images }, | |
| { where: { id: 'sdfw3edcs-dc-xwedsvc-ew' } }); |
| //tables | |
| define async createTag(tags, articleid): | |
| # schema tags = [{ tagid, tagname }] | |
| // articles { articleid ....} | |
| // article_tag { tagid, articleid } | |
| try { | |
| // Result is whatever you returned inside the transaction | |
| let result = await sequelize.transaction( async (t) => { |
| import chai from 'chai'; | |
| import chaiHttp from "chai-http"; | |
| import { app as server } from './app.js'; | |
| // configure chai to send/receive HTTP REQUEST | |
| chai.use(chaiHttp); | |
| describe("TDD for Users", () => { | |
| after(() => { | |
| server.close(); |