variants.test.ts 617 B

1234567891011121314151617181920212223
  1. import { literal } from '@sequelize/core';
  2. import { expect } from 'chai';
  3. import { sequelize } from '../../support';
  4. describe('Model.getInitialModel', () => {
  5. it('always returns the initial model', () => {
  6. const User = sequelize.define(
  7. 'User',
  8. {},
  9. {
  10. scopes: {
  11. scope1: {
  12. where: literal(''),
  13. },
  14. },
  15. },
  16. );
  17. expect(User.withSchema('abc').getInitialModel()).to.eq(User);
  18. expect(User.withSchema('abc').withScope('scope1').getInitialModel()).to.eq(User);
  19. expect(User.withScope('scope1').getInitialModel()).to.eq(User);
  20. });
  21. });