This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Boolean expressions', () => { | |
| [ | |
| // not | |
| { rule: 'not false', gives: true }, | |
| { rule: 'not true', gives: false }, | |
| { rule: 'not not true', gives: true }, | |
| // and | |
| { rule: 'true and true', gives: true }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| testFunction( | |
| isWholeBlockSelected, | |
| { | |
| inputToParams: input => { | |
| const state = createState(input) | |
| return [state.getCurrentContent(), state.getSelection()] | |
| }, | |
| cases: [ | |
| ['[>This is some text>]', true], | |
| ['T[>his is some text>]', false], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('isWholeBlockSelected()', () => { | |
| [ | |
| ['[>This is some text>]', true], | |
| ['T[>his is some text>]', false], | |
| ['[>This is some tex>]t', false], | |
| ['This is some text', false], | |
| ].forEach(([input, expected]) => { | |
| it(`"${input}" = ${expected}`, () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('isWholeBlockSelected()', () => { | |
| it('should detect whole block was selected', () => { | |
| const state = createState('[>This is some text>]') | |
| expect(isWholeBlockSelected(state.getCurrentContent(), state.getSelection())) | |
| .toBeTrue() | |
| }) | |
| it('should say whole block was not selected', () => { | |
| const state = createState('T[>his is some text>]') | |
| expect(isWholeBlockSelected(state.getCurrentContent(), state.getSelection())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const internalDescribe = (describeFn, bodyCaller) => (title, body) => | |
| describeFn(title, () => bodyCaller(body)) | |
| const createCustomDescribe = bodyCaller => { | |
| const customDescribe = internalDescribe(describe, bodyCaller) | |
| customDescribe.only = internalDescribe(describe.only, bodyCaller) | |
| customDescribe.skip = internalDescribe(describe.skip, bodyCaller) | |
| return customDescribe | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describeMongoDB('makeBulkMigration()', ({ getDb }) => { | |
| it('should create a migration that process some updates', async () => { | |
| // prepare some data in db | |
| await getDb().collection('tvshows').insertMany([ | |
| { name: 'hello susan', hour: 19 }, | |
| { name: 'another family night', hour: 22 }, | |
| { name: 'abc', hour: 8 }, | |
| { name: 'telefe news', hour: 12 }, | |
| { name: 'tv attacks', hour: 23 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default createDescribe(body => { | |
| let mongoServer | |
| let db | |
| beforeAll(async () => { | |
| mongoServer = new MongoMemoryServer() | |
| db = await mongodbFeature.setup({ config }, await mongoServer.getUri()) | |
| }) | |
| beforeEach(async () => { | |
| await Promise.all( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ar.edu.unq.o3 | |
| // modelo | |
| case class Programa(val elementos: List[ElementoPrograma]) | |
| trait ElementoPrograma | |
| case class Numero(val valor: Int) extends ElementoPrograma |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| NOMBRE_ENTREGA="checkpoint" | |
| NOMBRE_TAG="checkpoint" # esto podría calcularse segun fecha | |
| COMMIT_BASE="43f7b476bd17df52cee94b4d3d108b5344fd7b46" | |
| # CREAR BASE BRANCH | |
| git checkout -b "${NOMBRE_ENTREGA}-correccion" ${COMMIT_BASE} | |
| git push --set-upstream origin "${NOMBRE_ENTREGA}-correccion" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package ar.edu.unq.o3 | |
| object Hogwarts { | |
| // definiciones de tipos | |
| type Persona = (String, Niveles) | |
| type Niveles = (Int, Int, Int) | |
| type Efecto = Niveles => Niveles |